Create a program that reads a duration from the user as a number of days, hours, minutes, and seconds. Compute and display the total number of seconds represented by this duration.
Answers
Answered by
1
Required Coding in C++ is:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int D, H, M, S, a, b, c;
cout<< "Enter the numerical value of duration in the form of Days, Hours, Minutes, Seconds by pressing Enter Key after each value:";
cin>>D>>H>>M>>S;
a=D*86400;
b=H*3600;
c=M*60;
cout<<"The Entered Duration equals:"<<a+b+c+S<<" Seconds.";
getch();
}
Hope it helped all...:-)
Similar questions