Seconds to hours , minutes and seconds ( Chapter 2 Program 1 )
Also visit our YouTube Channel Tech Eos VISIT CHANNEL
/* 1 . Write a program to accept number of seconds and display
its corresponding hours, minutes and seconds. */
#include<stdio.h>
#include<conio.h>
void main()
{
int seconds , minute , hour;
clrscr();
printf("\nEnter seconds : ");
scanf("%d" , &seconds);
hour = seconds / 3600;
seconds = seconds % 3600;
minute = seconds / 60;
seconds = seconds % 60;
printf("\n\n%d : %d : %d " , hour , minute , seconds);
getch();
}
Comments
Post a Comment