// C Program to display Prime Numbers Between 1 and N #include int main() { int n=1, N, i, flag; printf("Enter two numbers(intervals): "); scanf("%d", &N); printf("Prime numbers between %d and %d are: ", n, N); while (n <= N) { flag = 0; for(i = 2; i <= n/2; ++i) { if(n % i == 0) { flag = 1; break; } } if (flag == 0) printf("%d ", n); ++n; } return 0; }