27 Mart 2017 Pazartesi

QT 24 SAAT FORMATLAMA



// QT  24 SAAT FORMATLAMA 


#include "format.h"
#include
#include 
#include 
#include
Format::Format()
{
   int hours,mins,seconds,x;
   std::cout << "Hours \n";
   std::cin >> hours;
   std::cout <<"Minutes  \n";
   std::cin >> mins;
   std::cout<<"\n Seconds \n";
   std::cin>>seconds;
   if(hours>24)
   {
       std::cout << "Invalid Entry ";
   }
   else
   {
       std::cout << "24 Hours Format \n";
       std::cout << "Hours :    Minutes :    Seconds :  " <<  " : "  << hours << " : " << mins <<" : " << seconds<< "  \n ";
   }
  if(hours>12)
  {
      hours = hours -12;
      std::cout << "12 Hours Format \n";
      std::cout << "Hours :    Minutes :    Seconds :  " <<  " : "   << hours << " : " << mins <<" : " << seconds<< "  \n  ";
  }

 else
  {
      std::cout << "Hours :    Minutes :    Seconds :  " <<  " : "  << hours << " : " << mins <<" : " << seconds<< "  \n ";
  }
}








Share: