Senin, 14 Maret 2016

KONVERSI NILAI

Konversi Nilai

#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) {
                string raptor_prompt_variable_zzyz;
                int nilai;
                char* z;
                cout<<"Masukan Nilai Yang Akan Dikonversikan = ";
                cout << raptor_prompt_variable_zzyz << endl;
                cin >> nilai;
                if (nilai>0 && nilai<=20)
                {
                                 z ="E";
                                 }
                                 else
                                 {
                                                if (nilai>20 && nilai<=40)
                                                {
                                                                z ="D";
                                                                }
                                                                else
                                                                {
                                                                                if (nilai>40 && nilai<=60)
         {
            z ="C";
         }
         else
         {
                if (nilai>60 && nilai<=80)
            {
               z ="B";
            }
            else
            {
               z ="A";
            }
         }
      }
   }
                cout << "Konversi nilai dari " <<nilai <<" yaitu "<<z << endl;
                return 0;

}


Tidak ada komentar:

Posting Komentar