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
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
Chemistry,
5 months ago
Computer Science,
5 months ago
Science,
5 months ago
Computer Science,
11 months ago
Physics,
11 months ago
English,
1 year ago
Math,
1 year ago