1. Bilangan Prima
#include <iostream.h>
#include <conio.h>
void main(){
for(int i=1; i<100; i++){
if(i==2 || i==3 || i==5 || i==7)
cout<<i<<", ";
if(i%2==0 || i%3==0 || i%5==0 || i%7==0)
continue;
else
cout<<i<<", ";
}
getch();
}
Gambar Setelah Program dijalankan :
2. Bilangan UnPrima
#include <iostream.h>
#include <conio.h>
void main(){
for(int
i=1; i<100; i++){
No comments:
Post a Comment