Program Menentukan Nilai Mahasiswa Menggunakan Bahasa C++

27 Mar

#include <iostream.h>

#include <conio.h>

void konversi()  {

int nilai;

cin>>nilai;

cout<<”Nilai huruf: “;

if ((nilai > 0) && (nilai <= 20))

cout<< “E”;

else if ((nilai > 20) && (nilai <= 40))

cout<< “D”;

else if ((nilai > 40) && (nilai <= 60))

cout<< “C”;

else if ((nilai > 60) && (nilai <= 80))

cout<< “B”;

else if ((nilai > 80) && (nilai <= 100))

cout<< “A”;

else cout<< “masukan salah”;        }

int main() {

cout<<”Masukkan Nilai anda:”;

konversi();

getch();

return 0;

}

 

Output:

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: