Program Penilaian Menggunakan IF ELSE pada C++
#include<iostream.h>
#include<conio.h>
void main()
{
int n ;
char lg ;
clrscr ;
lg='Y' ;
while(lg=='Y'|| lg=='y')
{
clrscr();
cout<<" Masukkan Nilai : " ;
cin>>n;
cout<<"\n";
if (n>=90)
cout<<"Nilai Anda (A)";
else if (n>=80)
cout<<"Nilai Anda (B)";
else if (n>=70)
cout<<"Nilai Anda (C)";
else if (n>=60)
cout<<"Nilai Anda (D)";
else if (n<=50)
cout<<"Nilai Anda (E)";
else
cout<< "Maaf nilai yang anda masukkan salah\n";
cout<< "\n\nIngin Mengulagi lagi [y/t] : " ;
cin>>lg ;
}
getch () ;
}
Hasil Program :
Sunday, 13 July 2014
Author: wardana
Etiam at libero iaculis, mollis justo non, blandit augue. Vestibulum sit amet sodales est, a lacinia ex. Suspendisse vel enim sagittis, volutpat sem eget, condimentum sem.
0 komentar: