#include <iostream.h>
#include <conio.h>
void main()
{
int nilai;
char mark;
clrscr();
cout<<"Masukkan nilai ujian [0 - 100]: ";
cin>>nilai;
cout<<"\n";
if(nilai >=90 && nilai <=100)
mark = 'A';
else if(nilai >=80 && nilai <=89)
mark = 'B';
else if(nilai >=65 && nilai <=79)
mark = 'C';
else if(nilai >=50 && nilai <=64)
mark = 'D';
else
mark = 'E';
cout<<"Nilai ujian = "<<mark;
getch();
}
#include <conio.h>
void main()
{
int nilai;
char mark;
clrscr();
cout<<"Masukkan nilai ujian [0 - 100]: ";
cin>>nilai;
cout<<"\n";
if(nilai >=90 && nilai <=100)
mark = 'A';
else if(nilai >=80 && nilai <=89)
mark = 'B';
else if(nilai >=65 && nilai <=79)
mark = 'C';
else if(nilai >=50 && nilai <=64)
mark = 'D';
else
mark = 'E';
cout<<"Nilai ujian = "<<mark;
getch();
}
Tidak ada komentar:
Posting Komentar