adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    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

b.

20000

c.

15000

d.

19844

Answer: (a).19845

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?

Similar Questions

Discover Related MCQs

Q. Which of the following is a properly defined structure?

Q. Which of the following accesses a variable in structure *b?

Q. The keyword used to define a structure is _____

Q. When accessing a structure member, the identifier to the left of the dot operator is the name of

Q. Using new may result in less _____ memory than using an array

Q. A difference, between reference variables and pointers is that

Q. The C++ expression p --> val means the same thing as

Q. One way in which a structure differs from an array is that _____

Q. When you declare a pointer, you must give it a _____

Q. An address is a _____ , while a pointer is a _____

Q. The function whose prototype is void getData(Item *thing); receives

Q. The number of structures than can be declared in a single statement is

Q. Which of the following statements will assign the address of the age variable to the agePtr pointer?

Q. The contents of two pointers that point to adjacent of type float differ by

Q. An asterisk placed after a data type means .

Q. Which of the following statements creates and initializes a pointer named salesPtr?

Q. If the code and fee arrays are parallel, the fee that corresponds to the code stored in the code[3] element is located in the _____ element

Q. To use the this pointer with a member function, you _____

Q. You have declared an integer pointer called point You have also declared an integer called number. Which statement is the correct format?

Q. Which of the following will increase the value stored in the first element of the fee array by 2?