Program Bilangan Prima By meldiya's_book 22:23 // No comments #include<stdio.h> #include void main () { clrscr(); int n,c=0; printf("masukan angka = ");scanf("%d",&n); printf("deret bilangan prima adalah\n"); for (int i=1;i<=n;i++) { for(int j=1;j<=i;j++) { if(i%j==0) { c++; } } if(c==2)printf("%d\t",i); c=0; } getch(); } Email ThisBlogThis!Share to XShare to Facebook
0 comments:
Post a Comment