Write a program that asks the user for a 24-hour time, then displays the time in 12-hour form: For example: Enter a 24-hour time: 21:11 Equivalent 12-hour time: 9:11 PM Be careful not to display 12:00 as 0:00.
#include main() { int hours, minutes; printf(\"Enter a 24-hour time: \"); scanf(\"%d:%d\", &hours, &minutes); /* assumption: midnight entered as 00:00, valid times are 00:00-23:59 */ printf(\"Equivalent 12-hour time: \"); if (hours == 0) printf(\"12:%.2d AM\ \", minutes); else if (hours < 12) printf(\"%d:%.2d AM\ \", hours, minutes); /* We used \"%d:%.2d