U

Uday Singh • 7.23K Points
Tutor III

Q. What is the output of this program?

Code:
#include 
    using namespace std;
    int add(int p, int q);
    int main()
    {
        int n = 15, m = 16;
        cout << add(n, m) << endl;
        return 0;
    }
    int add(int p, int q )
    {
        int sum = p + q;
        p = 20;
        return p + q;
    }
  • (A) 36
  • (B) 15
  • (C) 16
  • (D) 20
  • Correct Answer - Option(D)
  • Views: 215
  • Filed under category C++

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics