You are on page 1of 1

#include <stdio.

h>

int main(){

int i, num=1, count;

printf("Prime Number from 1 to 1000 are: \n");

do{

count = 0;

i = 2;

do{

if(num%i == 0){

count++;

break;

}i++;

}while(i <= num/2);

if(count == 0 && num != 1){

printf(" %d ", num);

}num++;

}while(num <= 1000);

return 0;

You might also like