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 else

#include<iostream.h>
void main()
{
int nilai ;

cout<<"Masukkan nilai yang didapat = ";cin>>nilai;

if(nilai>=85&&nilai <=100)
{
cout<<"Grade yang didapat adalah A "<<endl;
}

else if(nilai>=70&&nilai<=84)
{
cout<<"Grade yang didapat adalah B "<<endl;
}

else if(nilai>=60&&nilai<=69)
{
cout<<"Grade yang didapat adalah C "<<endl;
}

else if(nilai>=0&&nilai<=59)
{
cout<<"Grade yang didapat adalah D "<<endl;
}

else
{
cout<<"Nilai yang anda Masukkan salah "<<endl;
}

}

0 comments:

Post a Comment

Apa pendapat anda dengan BLOG ini ?