Write a program to generate prime numbers between 1 and 100 in c
Answers
Answered by
1
#include <stdio.h>
int main(void)
{
for(int i=2;i<100;i++)
{
for(int j=2;j<i;j++)
{
if(i%j==0)
break;
else if(i==j+1)
printf("%d\n",i);
}
}
}
Similar questions
Political Science,
7 months ago
Science,
7 months ago
Environmental Sciences,
1 year ago
Physics,
1 year ago