Sail E0 Webinar
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

Options:
A .  19845
B .  20000
C .  15000
D .  19844
Answer: Option A

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

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers