answersLogoWhite

0


Best Answer

#include<iostream>

using namespace std;

int main()

{

int t1;

int t2;

char a;

char p;

cout << "enter two numbers for example 0930 for 9:00 !" << endl;

cin >> t1;

cout << "enter number two" << endl;

cin >> t2;

cout >> "totel amount of hours are">>h>>endl;

system("PAUSE");

return 0;

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you convert time from 24 hour to 12 hour in C Plus Plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you convert 245 pm to 24 hour time?

Add on 12 so = 14:45 hours


Convert 3.15am to 24 hour time?

03:15am is the same in 24 hour time. And pm you need to add 12. For example 3.15pm would be 15.15


how do you read army time into real-time?

Convert military time by subtracting 12 hours, if the time is larger than 12:00, to get the 24 hour (standard time), then add “pm”.


How do you convert 25 minutes in a hour?

8/12 hr=


How do you convert 13 into time?

13, as in 1300 hours? That's 1 pm on the 24 hour clock (easy conversion, if the time is larger than 1200, subtract 1200 to get the time equivalent on the 12 hour clock)


What is 6 o'clock plus twelve?

6:12 or if you mean the hour plus 12 it would be 6


How do you convert military 2152 hours to 12 clock?

It is 9:52 PM. Here's how:For military time, the left two digits are the hour, and the right two digits are the minutes. It is based on a 24 hour clock, so hour 0000 represents midnight and anything 0001 - 0059 is 12:01 AM to 12:59 AM. The hours 01 through 11 will convert to the same time (AM). At 1200 is noon, so 1201 - 1259 is 12:01 PM - 12:59 PM. After that, you must subtract 12 from the hour number, to get the hour on a 12 hour clock (and it will be PM). So 1 hour after noon is 1:00 PM, but the equivalent military time is 1300.So 21 is greater than 12, so subtract 12: 21 - 12 = 9. Since it's greater than 12, it's PM. The minutes are still the same, so 9:52 PM.


Convert 216watts to Ampere Hour?

You can not convert Watts (Power) to Ampere-Hours (Amount of charge)!!! Exept if you know the voltage and the amount of time you use the power. For example: If you use P=216 W from a battery of V=12 Volts for t=1 hour, that would be: Current I=P/V=216/12=18 Amperes In time of 1 hour, you will take Q=I*t=18 Ampere-Hours from the 12 Volts battery.


What is hours in military time?

If the time is below 12, eg, 1100 hours, you do not need to convert, just add AM - 1100 hours is 11:00 AM If the time is above 12, you need to subtract 12 and add PM - 2100 hours &gt; (21-12=9) = 9:00 PM.


How do you convert a 12 hour clock to a 24 hour clock?

Add 12 to the number representing hours, from 1:00 pm to just before midnight.


How many minutes are left today?

When asked at 7:10pm on 23 Feb 2010 there were 290 minutes left. To calculate the number of minutes left, subtract the number of minutes so far from the number of minutes in a day. The number of minutes in a day is 24 hours &times; 60 minutes/hour = 1440 minutes. To calculate the number of minutes so far in a day multiply the hour (on the 24 hour clock) by 60 and add the minutes. To convert am/pm to 24 hour format: If the time is 12:something am subtract 12 hours to make the time 0:something; otherwise If the time is 12:something pm leave it along; otherwise if the time is something pm add 12 hours to the time. For 7:10 pm, convert to 24 hour: add 12 hours to get 19:10 Now convert to minutes so far: 19 &times; 60 + 12 = 1150 &rarr; minutes left = 1440 - 1150 = 290 minutes.


How to change time from 12 hour to 24 hour?

If the time is between midnight and 1 AM, call the hour "00" instead of "12". If the time is between 1 AM and 1 PM, both systems are exactly the same. If the time is between 1 PM and midnight, add 12 to the hour.