Mencari Ganjil,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 d;
cout<<"masukan nilai =";cin>>d;
if(d%2==0)
cout<<"genap";
else
cout<<"ganjil";
return 0;
}
//Hasil:
0 komentar:
Posting Komentar