Program menghitung ganjil dan genap


#include <iostream>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
int g;
cout<<"-----------------------------------"<<endl;
cout<<"Menentukan Nilai Ganjil dan Genap"<<endl;
cout<<"-----------------------------------"<<endl;
cout<<"Masukan nilai g : ";
cin>>g;
if (g % 2==0)
cout<<"Bilangan Genap"<<endl;
else
cout<<"Bilangan Ganjil"<<endl;
cout<<"------------------------------------"<<endl;
return 0;
}

Raptor :

Comments