C Programming Test

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?

  1.     #include <iostream>
  2.     using namespace std;
  3.     void Sum(int a, int b, int & c)
  4.     {
  5.         a = b + c;
  6.         b = a + c;
  7.         c = a + b;
  8.     }
  9.     int main()
  10.     {
  11.         int x = 2, y =3;
  12.         Sum(x, y, y);
  13.         cout << x << " " << y;
  14.         return 0; 
  15.     }

a) 2 3
b) 6 9
c) 2 15
d) compile time error

"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.


Discount Code: CIPD30



Click ORDER NOW..

order custom paper