Advertisement
labib24

Untitled

Jan 13th, 2023
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int t,y,a,M,b,c,d,e,h,m,s;
  5.     printf("Enter seconds : ");
  6.     scanf("%d",&t);
  7.     y=t/31536000;
  8.     a=t%31536000;
  9.     M=a/2592000;
  10.     b=a%2592000;
  11.     d=b/86400;
  12.     c=b%86400;
  13.     h=c/3600;
  14.     e=c%3600;
  15.     m=e/60;
  16.     s=e%60;
  17.     printf("%d years %d months %d days %d hours %d minutes %d seconds\n",y,M,d,h,m,s);
  18. }
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement