1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
#include <stdio.h>
void main()
{
int hh,mm,ss;
char number[50][24]={"Midnight","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven"};
printf("Enter hour(s):");
scanf("%2d",&hh);
printf("Enter minute(s):");
scanf("%2d",&mm);
printf("Enter seconds(s):");
scanf("%2d",&ss);
printf("\nOutput");
printf("\n%2d:%2d:%2d\n",hh,mm,ss);
if(mm=45 && hh<=23 && hh>=0)
{
hh=hh+1;
printf("Quater to %s.\n\n",number[hh]);
}
else printf("Invalid Input.\n\n");
}
|