Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- struct time{
- int seconds;
- int minutes;
- int hours ;
- };
- struct time splittime(long long totalseconds);
- int main()
- {
- struct time x;
- long long totalseconds;
- printf("enter the total seconds ");
- scanf("%lld",&totalseconds);
- x=splittime(totalseconds);
- printf("number of hours %d minutes %d seconds %d ", x.hours , x.minutes , x.seconds);
- return 0;
- }
- struct time splittime(long long totalseconds)
- {
- struct time x;
- x.hours=totalseconds/3600;
- x.minutes=totalseconds%3600/60;
- x.seconds=totalseconds%3600%60;
- return x ;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement