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
1 Posted Topic
Re: /* 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(); }( |
The End.