πŸ“Š C++
Q. What is the new value of P?
Code:
#include 
    using namespace std;
    void function(int &p)
    {
        p = 15;
    }
    int main()
    {
         int p = 12;
         function(p);
         cout << "New value of P is " << p;
         return 0;
    }
  • (A) New value of P is 12
  • (B) Compilation Error
  • (C) New value of P is 15
  • (D) Runtime Error
πŸ’¬ Discuss
βœ… Correct Answer: (C) New value of P is 15

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

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