Question: PROGRAM IN C Given a time in 12-hour AM/PM format, convert it to military (24-hour) time. Note: Midnight is 12:00:00AM on a 12-hour clock, and

PROGRAM IN "C"

Given a time in 12-hour AM/PM format, convert it to military (24-hour) time.

Note: Midnight is 12:00:00AM on a 12-hour clock, and 00:00:00 on a 24-hour clock.

Input Format

A single string containing a time in 12-hour clock format (i.e.:hh:mm:ssAM or hh:mm:ssPM )

Output Format

Convert and print the given time in 24-hour format, where 00<=hh<=23.

Sample Input

07:05:45PM 

Sample Output

19:05:45 

>>>>>>>>>>>>>>>>>>>>>>>>>>C program>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

char* timeConversion(char* s) { // Complete this function }

int main() { char* s = (char *)malloc(512000 * sizeof(char)); scanf("%s", s); int result_size; char* result = timeConversion(s); printf("%s ", result); return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!