| | |
Print Prime Numbers(using for loop)
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Sep 2009
Posts: 1
Reputation:
Solved Threads: 0
C Syntax (Toggle Plain Text)
#include<stdio.h> void main() int i,j,prime; for(i=2;i<=500;i++) for(j=2;j<500;j++) { if(i%j=o) { prime=0; break; } prime=1; if(prime) { printf("\n%d",i); } } }
Last edited by ~s.o.s~; Sep 4th, 2009 at 12:09 am. Reason: Added code tags, please learn to use them.
![]() |
Similar Threads
- Help with prime numbers (C)
- C++ Finding Prime Numbers (C++)
- (Noob) need some help w/ Prime Numbers (C++)
- prime numbers (C++)
Other Threads in the C Forum
- Previous Thread: game 2d array search help
- Next Thread: Had a homework problem in c programming and need help!!
| Thread Tools | Search this Thread |
Tag cloud for C
adobe ansi api array arrays asterisks bash binarysearch calculate centimeter char convert copyanyfile copyimagefile copypdffile cprogramme createcopyoffile csyntax directory dynamic fflush file fork frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hacking hardware highest homework i/o inches incrementoperators infiniteloop initialization interest km lazy linked linkedlist linux linuxsegmentationfault list locate logical_drives match matrix meter microsoft motherboard multi mysql number open opendocumentformat opensource owf pattern pdf performance pointer pointers posix power problem probleminc program programming pyramidusingturboccodes read recursion recv repetition scanf scheduling scripting segmentationfault send shape socketprograming spoonfeeding stack standard string strings structures suggestions systemcall test testautomation unix user variable voidmain() wab win32api windows.h





