Vidyalelo
C++ Programming · Q28

Structures and Unions in C++

Programming · C++ Programming · question 28

Q28

What will be the output of the following C++ code? #include using namespace std; struct Time int hours; int minutes; int seconds; ; int toSeconds(Time now); int main() Time t; t.hours = 5; t.minutes = 30; t.seconds = 45; cout << "Total seconds: " << toSeconds(t) << endl; return 0; int toSeconds(Time now) return 3600 * now.hours + 60 * now.minutes + now.seconds;

A.
19845
Answer
B.
20000
C.
15000
D.
19844

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board