#include <conio.h>
main()
{
int prim, cek, i;
cout<<"PROGRAM MENCETAK BILANGAN PRIMA"<<endl<<endl;
cout<<endl;
cout<<"Deret Bilangan Prima 1 sampai 100 : "<<endl<<endl;
for (prim = 2; prim<=100; prim++)
{
cek = 0;
for (i = 2; i < prim; i++)
{
if (prim % i == 0)
{
cek = 1;
}
}
if (cek == 0)
{
cout<<prim<<", ";
}
}
{
cout<<endl<<endl<<endl;
cout<<"DIAR FAJRIL FIRDAUS "<<endl;
cout<<"Kelas A";
}
getch();
}
Tidak ada komentar:
Posting Komentar