Computer Science, asked by patnaikmanoj09, 11 months ago

Blue J program
1. Write a application that read values representing a time duration during hours, minutes and seconds. And then print the equivalent total number of seconds. For example 1 hours , 28 minutes and 42 seconds is equivalent to 5322 seconds.​

Answers

Answered by programmer74
0

Explanation:

//C program

#include<stdio.h>

int main(void){

int hours, min, secs, total;

printf("Enter hours: ");

scanf(" %d", &hours);

printf("\nEnter minutes: ");

scanf(" %d", &min);

printf("\nEnter seconds: ");

scanf(" %d", &secs);

printf("\nFormat: %d h %d m %d s", hours, min, secs);

total = (hours*3600)+(min*60)+secs;

printf("\nSeconds: %d", total);

return 0;

}

Similar questions