Cara Mengetahui 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 x; cin>>x;
if(x%2==1)
cout<<"Ganjil";
else cout<<"Genap";
return 0;
}
Output
/* 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 x; cin>>x;
if(x%2==1)
cout<<"Ganjil";
else cout<<"Genap";
return 0;
}
Output
0 komentar:
Posting Komentar