Selamat Datang Di Blogg Saya

Sabtu, 17 Maret 2012

program Konversi ke hari

flowchart

 


C++

#include <iostream>
#include <string>

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

   raptor_prompt_variable_zzyz ="input hari ( ex : 1 )";
   cout << raptor_prompt_variable_zzyz << endl;
   cin >> a;
   if (a==1)
   {
      cout << "senin" << endl;   }
   else
   {
      if (a==2)
      {
         cout << "selasa" << endl;      }
      else
      {
         if (a==3)
         {
            cout << "rabu" << endl;         }
         else
         {
            if (a==4)
            {
               cout << "kamis" << endl;            }
            else
            {
               if (a==5)
               {
                  cout << "juma't" << endl;               }
               else
               {
                  if (a==6)
                  {
                     cout << "sabtu" << endl;                  }
                  else
                  {
                     if (a==7)
                     {
                        cout << "minggu" << endl;                     }
                     else
                     {
                        cout << "tidak ada hari" << endl;                     }
                  }
               }
            }
         }
      }
   }
system("PAUSE");
   return 0;
}



0 comments:

Posting Komentar