Created
October 29, 2013 08:34
-
-
Save fgodino/7210967 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstdlib> | |
#include <math.h> | |
int main(){ | |
int B=2, C=2, D=0, I=0, E; | |
printf("Hasta que Numero Quiere que Calcule Los Numeros Primos: "); scanf("%d",&E); | |
for(B;B<=E;B++){ | |
C=2; | |
while((C<=B) && (B%C!=0)){ | |
C++;} | |
if(B==C){printf("%6d",C); D++; I++; if(D==10){printf("n");D=0;}} | |
} | |
printf("nTotaL D NuMeRoS pRiMoS eS D: %dn",I); | |
system("PAUSE"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment