P. 1
genap ganjil

genap ganjil

|Views: 1|Likes:
Published by Zandix Arta

More info:

Published by: Zandix Arta on Jul 11, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as TXT, PDF, TXT or read online from Scribd
See more
See less

07/11/2011

pdf

text

original

#include <iostream.h> #include <conio.

h> main(){ int bil; cout<<"Masukkan Bilangan yang akan dicek = "; cin>>bil; if (bil > 0) cout<<bil<<" adalah bilangan Positif"; else if (bil < 0) { cout<<bil<<" adalah bilangan Negatif"; } else if (bil==0) { cout<<"Anda mengInputkan bilangan Nol (0)\n"; } else { cout<<"inputan salah"; } getch();}

#include <iostream.h> #include <conio.h> void gnpgnj(int angka) {for(int x=0;x<=angka;x++) { if (x==0) cout<<x<<" = bil 0\n"; else if (x%2==1) cout<<x<<" = bil ganjil\n"; else cout<<x<<" = bil genap\n"; } } main() { int angka; cout<<"masukkan batas : ";cin>>angka; gnpgnj(angka); getch(); }

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->