Senin, 17 Maret 2014

ALGORITMA DAN PEMOGRAMAN KONVERSI HARI


#include <iostream>
#include <string>

using namespace std;
int main()
{
   string raptor_prompt_variable_zzyz;
   int H;

   raptor_prompt_variable_zzyz ="Masukan HARI";
   cout << raptor_prompt_variable_zzyz << endl;
   cin >> H;
   if (H==1)
   {
      cout << "Senin" << endl;   }
   else
   {
      if (H==2)
      {
         cout << "selasa" << endl;      }
      else
      {
         if (H==3)
         {
            cout << "rabu" << endl;         }
         else
         {
            if (H==4)
            {
               cout << "kamis" << endl;            }
            else
            {
               if (H==5)
               {
                  cout << "jumat" << endl;               }
               else
               {
                  if (H==6)
                  {
                     cout << "sabtu" << endl;                  }
                  else
                  {
                     cout << "minggu" << endl;                  }
               }
            }
         }
      }
   }

   return 0;
}












Share:

Tidak ada komentar:

Posting Komentar

© journey of life All rights reserved | Theme Designed by Seo Blogger Templates