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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started