Q. What is the output of this program?

Code:
#include 
    using namespace std;
    int add(int p, int q);
    int main()
    {
        int k = 7, L = 9;
        cout << add(k, L) << endl;
        return 0;
    }
    int add(int p, int q )
    {
        int sum = p + q;
        p = 10;
        return p + q;
    }
  • (A) 7
  • (B) 9
  • (C) 10
  • (D) 19
πŸ’¬ Discuss
βœ… Correct Answer: (D) 19

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
309
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Uday Singh
Publisher
πŸ“ˆ
82%
Success Rate