שאלה בקשר לשפת סי
אני רק התחלתי ללמוד, ואני מנסה לעשות תכונית שבודקת ומדפיסה את כל המספרים הראשוניים מ1 עד 100. מה אני לא עושה נכון? #include <stdio.h> #include <math.h> #include <conio.h> void main() { int i,n; clrscr(); printf("1 2 "); for(n=3;n>=100;n+=2); { for(i=2;i>=sqrt
;i++); if(n%i!=0) printf("%d ",n); } }
אני רק התחלתי ללמוד, ואני מנסה לעשות תכונית שבודקת ומדפיסה את כל המספרים הראשוניים מ1 עד 100. מה אני לא עושה נכון? #include <stdio.h> #include <math.h> #include <conio.h> void main() { int i,n; clrscr(); printf("1 2 "); for(n=3;n>=100;n+=2); { for(i=2;i>=sqrt