c questions 9

What is the output of this program?

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

a) 2 5 10
b) 2 4 5
c) 2 6 14
d) none of the mentioned

What is the new value of x?

  1.     #include <iostream>
  2.     using namespace std;
  3.     void fun(int &x)
  4.     {
  5.         x = 20;
  6.     }
  7.     int main()
  8.     {
  9.          int x = 10;
  10.          fun(x);
  11.          cout << "New value of x is " << x;
  12.          return 0;
  13.     }

a) 10
b) 20
c) 15
d) none of the mentioned

 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.