What will be the output of the following C++ code?#include using namespace std;void Sum(int a, int b, int & c){a = b + c;b = a + c;c = a + b;}int main(){int x = 2, y =3;Sum(x, y, y);cout

🎲 Try a Random Question  |  Total Questions in Quiz: 93  |  🧠 Study this quiz with Flashcards
This question is part of a full practice quiz:
C++ Programming Practice Test: Functions, Namespaces & Exceptions in C++ — practice the complete quiz, review flashcards, or try a random question.

Quiz on function declaration and overloading, operators and statements, values and arguments, macros, namespaces and exceptions. Functions: A function is a block of code that performs a specific task. Functions can take input parameters and return output values. They are used to organize code and make it more reusable. Namespaces: A namespace is a way to organize code into logical groups. Namespaces can be used to avoid naming conflicts and to make code more readable. To define a namespace in C++, you use the following syntax: C++ namespace namespace_name {   // code in the... Show more

What will be the output of the following C++ code?<br>#include <iostream><br>using namespace std;<br>void Sum(int a, int b, int & c)<br>{<br>a = b + c;<br>b = a + c;<br>c = a + b;<br>}<br>int main()<br>{<br>int x = 2, y =3;<br>Sum(x, y, y);<br>cout << x << " " << y;<br>return 0; <br>}