adplus-dvertising
frame-decoration

Question

What is the output of the following program?
    #include <iostream>
    using namespace std;
    int f(int p, int q)
    {
        if (p > q)
            return p;
        else
            return q;
    }
    main()
    {
        int a = 5, b = 10;
        int k;
        bool x = true;
        bool y = f(a, b);
        k =((a * b) + (x + y));
        cout << k;
    }

a.

55

b.

62

c.

52

d.

none of the mentioned

Answer: (c).52

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 the following program?

Similar Questions

Discover Related MCQs

Q. Evaluate the following
(false && true) || false || true

Q. How many characters are specified in the ASCII scheme?

Q. Select the right option.

Given the variables p, q are of char type and r, s, t are of int type
1. t = (r * s) / (r + s);
2. t = (p * q) / (r + s);

Q. Which of the following belongs to the set of character types?

Q. How do we represent a wide character of the form wchar_t?

Q. In C++, what is the sign of character data type by default?

Q. Is the size of character literals different in C and C++?

Q. Suppose in a hypothetical machine, the size of char is 32 bits. What would sizeof(char) return?

Q. What constant defined in <climits> header returns the number of bits in a char?

Q. The size_t integer type in C++ is?

Q. Which of these expressions will return true if the input integer v is a power of two?

Q. Which of these expressions will make the rightmost set bit zero in an input integer x?

Q. Which of these expressions will isolate the rightmost set bit?

Q. 0946, 786427373824, ‘x’ and 0X2f are _____ _____ ____ and _____ literals respectively.

Q. Which of the following is not one of the sizes of the floating point types?

Q. Which of the following is a valid floating point literal?

Q. What is the range of the floating point numbers?

Q. Which of three sizes of floating point types should be used when extended precision is required?

Q. Which is used to indicate single precision value?

Q. The size of an object or a type can be determined using which operator?