Slide # 1

Slide # 1

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts Read More

Slide # 2

Slide # 2

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts Read More

Slide # 3

Slide # 3

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts Read More

Slide # 4

Slide # 4

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts Read More

Slide # 5

Slide # 5

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts Read More

Wednesday, April 20, 2011

Menggunakan fungsi IF

# include<iostream.h>
void main()
{
int x;
cout<<"Masukkan nilai yang anda inginkan = ";cin>>x;
if(x%2==0)
{
cout<<"Nilai yang anda masukkan adalah bilangan genap"<<endl;
}
else
{
cout<<"Nilai yang anda masukkan adalah bilangan ganjil"<<endl;
}
}

Contoh program diatas digunakan untuk membedakan apakah bilangan yang kita masukkan adalah bilangan genap atau gajil,,,,,


cyclops

0 comments:

Post a Comment

Apa pendapat anda dengan BLOG ini ?