Computer Science, asked by srijadutta2014, 1 day ago

Write a program in c to provide the following multiple functions based upon the user’s choice: (1) Convert the entered Years into Minutes (2) Convert the entered Years into Hours (3) Convert the entered Years into Days (4) Convert the entered Years into Months (5) Convert the entered Years into Seconds (6) Exit.​

Answers

Answered by KULDIPPAWAR27
1

Answer:

#include <stdio.h>

int main() {

int sec, h, m, s;

printf("Input seconds: ");

scanf("%d", &sec);

h = (sec/3600);

m = (sec -(3600*h))/60;

s = (sec -(3600*h)-(m*60));

printf("H:M:S - %d:%d:%d\n",h,m,s);

return 0;

}

Sample Output:

Input seconds: 25300

H:M:S - 7:1:40

Similar questions