Question
What is the output of this program?
1.
#include
2.
using namespace std;
3.
struct Time {
4.
int hours;
5.
int minutes;
6.
int seconds;
7.
};
8.
int toSeconds(Time now);
9.
int main()
10.
{
11.
Time t;
12.
t.hours = 5;
13.
t.minutes = 30;
14.
t.seconds = 45;
15.
cout
Answer: Option A
Was this answer helpful ?
In this program, we are just converting the given hours and minutes into seconds.
Output:
$ g++ stu1.cpp
$ a.out
Total seconds:19845
Was this answer helpful ?
Submit Solution