60 515
Assignments Done
98,1%
Successfully Done
In April 2018

Answer to Question #22267 in C++ for patrick

Question #22267
i need a c++ program that lets you input a time and outputs the different time from the different time zones, UTC -12 up to UTC +12
Expert's answer
#include <iostream>
using namespace std;

int i, h, m;

void main(){

cout<<"enter the hours: ";
cin>>h;
cout<<"enter the minutes: ";
cin>>m;

for (i = -12; i< 13; i++)
cout<<"UTC "<<i<<": "<<(h+i)%24<<":"<<m<<"\n";

system("pause");

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions