ganjil apa genap.,,

#include<iostream.h>

#include<conio.h>

using namespace std;

int main()

{

char q;

int bilangan,hasil;

do

{

system(“cls”);

cout<<” | ========================|”<<endl;

cout<<” | Program Identifikasi Ganjil/Genap |”<<endl;

cout<<” |========================|”<<endl<<endl;

cout<<” Masukkan Bilangan : “;

cin>>bilangan;

cout<<endl;

hasil = bilangan%2;

if (hasil == 0)

{

cout<<” ” << bilangan <<” adalah : Bilangan genap”;

}

else

{

cout<<” ” << bilangan <<” adalah : Bilangan ganjil”;

}

cout<<endl<<endl;

cout<<” Ingin Hitung Kembali (y/t)?”;

cin>>q;

}

while(q==’y’);

return 0;

}

ganjilgenap

This entry was posted in Struktur Control and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *