Code:#include<stdio.h> #include<conio.h> //THIS IS A PROGRAM THAT WILL CALCULATE MILITARY TIME TO STANDARD TIME void convertTime(int,int); int main() { int x,y; printf("Input Military Time \nhours :"); scanf("%d",&x); printf("minutes :"); scanf("%d",&y); convertTime(x,y); return 0; } void convertTime(int nhours, int nminutes) { int nMilitaryH,nMilitaryM; //output hours,output minutes if(nhours>12&&nhours<=23&&nminutes<60) //PM calculation { nMilitaryH=nhours-12; //hours nMilitaryM=nminutes-.00; //minutes printf("%d:%.2d PM",nMilitaryH,nMilitaryM); } if(nhours==24&&nminutes==0) { nMilitaryH=nhours-12; //hours //midnight calculation nMilitaryM=nminutes-.00; //minutes printf("%d:%.2d AM",nMilitaryH,nMilitaryM); } if(nhours==0&&nminutes<60) //calculates if hours is 00--its AM/Midnight up { nMilitaryH=12; //hours nMilitaryM=nminutes-.00; //minutes printf("%d:%.2d AM",nMilitaryH,nMilitaryM); } if(nhours==12&&nminutes<60) //calculates if hours is 12--its PM/noon up { nMilitaryH=12; //hours nMilitaryM=nminutes-.00; //minutes printf("%d:%.2d PM",nMilitaryH,nMilitaryM); } if(nhours<12&&nhours>0&&nminutes<60) //AM calculation { nMilitaryH=nhours; //hours nMilitaryM=nminutes-.00; //minutes printf("%d:%.2d AM",nMilitaryH,nMilitaryM); } if(nhours>=24&&nminutes>0||nminutes>59) //error calculation--invalid input {printf("\n\n\nERROR!\nPlEASE TRY AGAIN!");} }