APC-PRAC-006.c (433B)
1 /* WAP that accept seconds as input and represent it an hours, minutes and seconds. */ 2 3 #include <stdio.h> 4 int main() 5 { 6 int sec, hours, minutes, temp; 7 printf("Enter the no of seconds : "); 8 scanf("%d", &sec); 9 temp = sec; 10 hours = sec / 3600; 11 sec = sec % 3600; 12 minutes = sec / 60; 13 sec = sec % 60; 14 printf("\n%d Seconds = %d Hours, %d Minutes, %d Seconds.", temp, hours, minutes, sec); 15 return 0; 16 }