Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
0% Quality Score
Upvotes Received
0
Posts with Upvotes
0
Upvoting Members
0
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
0 Endorsements
Ranked #107.55K
~3K People Reached
Favorite Forums
Favorite Tags
c x 1

1 Posted Topic

Member Avatar for john_hasan

/* print prime number using for loop */ #include<stdio.h> #include<conio.h> #include<math.h> main() { clrscr(); int i,j,n; printf("Enter a value : "); scanf("%d",&n); printf("2 3 "); for(i=2;i<=n;i++) { for(j=2;j<=sqrt(i);j++) { if(i%j==0) { break; } if(j>sqrt(i)-1) printf("%d ",i); } } getch(); }(

Member Avatar for aizam76
-1
3K

The End.