Jumat, 16 September 2016

PROGRAM KONVERSI NILAI MHS DARI ANGKA KE HURUF (menggunakan C++)



#include <iostream>

/* run this program using the console pauser or add your own getch, system("pause") or input loop /
using namespace std;
int main(int argc, char* argv) {
    
    int nilai;
    cout<<"Masukkan nilai Mahasiswa : ";
    cin>>nilai;
    {
    if (nilai >= 80 && nilai <=100){
        cout<<"A";
    }
    else if (nilai >= 65 && nilai <=79){
        cout<<"B";
    }
    
    else if (nilai >= 55 && nilai <=64){
        cout<<"C";
    }
    else if (nilai >= 40 && nilai <=54){
        cout<<"D";    
    }
    else{
        cout<<"E";
    }
    
}
    
    return 0;
}



RUN & COMPILE


Tidak ada komentar:

Posting Komentar