-
What is the output of this program?
#include
using namespace std;
struct T
{
int H;
int M;
int S;
};
int Seconds(T now);
int main()
{
T t;
t.H = 6;
t.M = 3;
t.S = 15;
cout << "Total seconds: " << Seconds(t) << endl;
return 0;
}
int Seconds(T now)
{
return 3600 * now.H + 60 * now.M + now.S;
}
-
- Total seconds: 21795
- Total seconds: 20000
- Total seconds: 21000
- Total seconds: 21005
- Total seconds: 19000
Correct Option: A
In this program, we are just converting the given hours and minutes into seconds.