-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSecondsConvert.c
More file actions
26 lines (21 loc) · 862 Bytes
/
Copy pathSecondsConvert.c
File metadata and controls
26 lines (21 loc) · 862 Bytes
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
/*----------------------------------------------------------------------------------------------------------------------------------------------------------
SecondsConvert.c
Program to convert seconds into hours, minutes and seconds
DIVYA RAJ K
09-09-2018
-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
#include<stdio.h>
main()
{
int Hours,Minutes,Seconds,TotalSeconds;
system("clear");
printf("Program to convert seconds into hours, minutes and seconds\n\n");
printf("Enter the total number of seconds:\n");
scanf("%d",&Seconds);
TotalSeconds=Seconds;
Hours=Seconds/3600;
Seconds=Seconds%3600;
Minutes=Seconds/60;
Seconds=Seconds%60;
printf("\n%d seconds = %d hours %d minutes and %d seconds",TotalSeconds,Hours,Minutes,Seconds);
}