c programming test
What will happen when we use void in argument passing?
a) It will not return value to its caller
b) It will return value to its caller
c) Maybe or maynot be return any value to its caller
d) None of the mentioned
What is the output of this program?
-
#include <iostream>
-
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 << x << " " << y;
-
return 0;
-
}
a) 2 3
b) 6 9
c) 2 15
d) compile time error