#include
void main()
{
int bil;
int i,j,counter;
printf("Masukkan batas atas deret : ");
scanf("%d",&bil);
printf("\n");
for(i=1;i<=bil;i++)
{
counter=0;
for(j=1;j<=i;j++)
{
if(i%j==0) counter++;
}
if(counter==2)
{
printf("%d ",i);
}
}
printf("\n\n");
}
Home » algoritma » Deret Bilangan Prima
Deret Bilangan Prima
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment