# include <iostream.h>
# include <conio.h>
main ()
{
int bil;
clrscr();
cout <<"Masukkan bilangan ! [1-100]: ";
cin >>bil;
if(bil<50)
{
if(bil%2) //Jika bil habis dibagi 2, maka
{
cout <<"Bilangan < 50";
cout <<"Bilangan GENAP";
}
else //Jika bil tidak habis dibagi 2, maka
{
cout <<"Bilangan < 50";
cout <<"Bilangan GANJIL";
}
}
else
{
if(bil%2)
{
cout <<"Bilangan >= 50";
cout <<"Bilangan GENAP";
}
else
{
cout <<"Bilangan >= 50";
cout <<"Bilangan GANJIL";
}
}
getch();
}
Search
Categories
- Part I : Perkenalan (4)
- Part II : Operator (3)
- Part III : Percabangan (materi) (2)
- Part III : Percabangan (program) (4)
- Part IV : Perulangan (meteri) (3)
- Part IV : Perulangan (program) (3)
- Part V : Array (materi) (1)
- Part V : Array (program) (2)
- Penerapan (6)
- Pointer (2)
- Searching (pencarian) (3)
- Typedef (1)