| | |
Prime numbers from 1 to 100
![]() |
•
•
Join Date: Nov 2009
Posts: 4
Reputation:
Solved Threads: 0
-2
#3 20 Days Ago
c Syntax (Toggle Plain Text)
#include <math.h> #include <stdio.h> int main(void){ int i, j, isPrime; for(i = 2 ; i <= 100 ; i++){ isPrime = 1; for(j = 2 ; j <= i ; j++) { if( i == j) continue; else if( i % j == 0) isPrime = 0; } if(isPrime) printf("%d, ", i); } printf("\n"); return 0; }
hope this helps...
Last edited by mruthyunjaya; 20 Days Ago at 7:58 am. Reason: wrong variable name
![]() |
Similar Threads
- prime numbers output. while loop inside a do-while loop having trouble (C++)
- prime numbers (Java)
- Standard Output Error: Forking to Obtain Prime Numbers (C++)
- finding prime numbers problem (C++)
- Program to output all prime numbers between 3 and 100 (C++)
- Average of prime number between 1 & 100 (C#)
- help with array that determines prime numbers (C)
Other Threads in the C Forum
- Previous Thread: non preemptive scheduler
- Next Thread: No such file or directory
| Thread Tools | Search this Thread |
#include adobe api array arrays asterisks binarysearch calculate char cm copyanyfile copyimagefile copypdffile cprogramme creafecopyofanytypeoffileinc createcopyoffile createprocess() csyntax database directory dynamic feet fflush fgets file fork forloop frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hacking hardware highest homework i/o include incrementoperators input interest kernel kilometer km linked linkedlist linux linuxsegmentationfault list locate logical_drives loopinsideloop. match matrix meter microsoft motherboard mqqueue mysql number odf open opensource owf pattern pdf performance pointer posix probleminc process program programming pyramidusingturboccodes radix read recursion recv repetition research scanf scheduling segmentationfault send sequential shape socket socketprograming stack standard string systemcall turboc unix user voidmain() wab win32api windows.h





