/*convert seconds into hours,minutes & remaning seconds */
#include<stdio.h> #include<conio.h> void main() { int a,hours,minutes,rh,rm,sec; clrscr(); printf("enter seconds\n"); scanf("%d",&a); hours=a/3600; rh=a%3600; minutes=rh/60; rm=rh%60; sec=rm; printf("hours=%d",hours); printf("\nminutes=%d",minutes); printf("\nsec=%d",sec); getch(); }
No comments:
Post a Comment