Kasus 3.4

Konversi nilai angka ke nilai huruf menggunakan C++ :

#include <iostream>
#include <string>

using namespace std;
int main(){
   int nilai;

   cout << "Masukkan nilai angka : ";
   cin >> nilai;
   if (nilai>0 && nilai<=20)
   {
      cout << "Nilai huruf = E" << endl;   }
   else
   {
      if (nilai>20 && nilai<=40)
      {
         cout << "Nilai huruf = D" << endl;      }
      else
      {
         if (nilai>40 && nilai<=60)
         {
            cout << "Nilai huruf = C" << endl;         }
         else
         {
            if (nilai>60 && nilai<=80)
            {
               cout << "Nilai huruf = B" << endl;            }
            else
            {
               cout << "Nilai huruf = A" << endl;            }
         }
      }
   }

   return 0;

}
Konversi nilai angka ke nilai huruf menggunakan Raptor :





Share this

Related Posts

:)
:(
hihi
:-)
:D
=D
:-d
;(
;-(
@-)
:P
:o
:>)
(o)
:p
:-?
(p)
:-s
(m)
8-)
:-t
:-b
b-(
:-#
=p~
$-)
(y)
(f)
x-)
(k)
(h)
cheer