Coding Now – Best AI & Full Stack Courses in Delhi NCR | 100% Placement
Limited Offer: Get 50% OFF on AI & Full Stack Courses
📞 Call Now: +91 9667708830
Home Community WAC to print all prime numbers between 1 and 100

WAC to print all prime numbers between 1 and 100

Soham  •  Jul 17, 2026  •  3 views
0

2 Answers

Soham
Jul 17, 2026
#include <stdio.h>

int main()
{
int i, j, count;

for(i = 2; i <= 100; i++)
{
count = 0;

for(j = 1; j <= i; j++)
{
if(i % j == 0)
count++;
}

if(count == 2)
printf("%d ", i);
}

return 0;
}
Soham
Jul 17, 2026
#include <stdio.h>

int main()
{
int i, j, count;

for(i = 2; i <= 100; i++)
{
count = 0;

for(j = 1; j <= i; j++)
{
if(i % j == 0)
count++;
}

if(count == 2)
printf("%d ", i);
}

return 0;
}

Your Answer

Will not be displayed publicly
💬 Talk to Advisor
1
WhatsApp

Latest from Our Blog

Insights on AI, Data Science, Full Stack & Career

View All Articles →