You are on page 1of 1

My C Guide

#include<stdio.h> int main() { int i, j,n; i = 1; printf("Pls enter the value of n\n"); scanf("%d",&n); while ( i < n) { j = 2; while ( j < sqrt(i) ) { if ( i % j == 0 ) break; else { ++j; continue; } } if ( j > sqrt(i) ) printf("%d\t\n", i); ++i; } }

You might also like