//program menentukan bilangan prima
#include "iostream.h"
# include "iomanip.h"
# include "string.h"
# include "conio.h"
# include "stdio.h"
void tunggu(void)
{
long int i;
for(i=0; i<6e6; i++); } main() { int bil,n=2,p,k=1,bilj=0,lo,y,x,ket,kl=1; char lagi; awal: if (kl==2){ textcolor(175); }else if(kl==3){ textcolor(90); }else if(kl==4){ textcolor(20); }else if(kl>=5){
textcolor(25);
}
clrscr();
cout<
textcolor(145);
cout<
textcolor(10);
}
do
{
x=40+i; y=11;
gotoxy(x,y);
cout<<"."; tunggu(); x=40+i; y=11; gotoxy(x,y); cout<<" "; tunggu(); i++; }while(i<18); cprintf(" Please wait....."); if(bil>=0){
i=0;
do
{
x=75-i; y=11;
gotoxy(x,y);
textcolor(55);
cprintf(".");
tunggu();
x=75-i; y=11;
gotoxy(x,y);
cout<<" "; tunggu(); i++; }while(i<18); } } } if (bil<=2){ cout<<" Bilangan itu prima."<
for(p=1;p<=k;p++){ bilj=bil%n; if (bilj==0){ cout<<" Bukan bilangan prima."<
if (lagi=='y' || lagi=='Y'){
bil=0;
n=2;
k=1;
kl++;
goto awal;
}
clrscr();
cout<
Tidak ada komentar:
Posting Komentar