Functions Q.7

0. int a =1 , b=2;

a=chg(b) ;

cout << a << b ;

If the function chg is coded as


int chg(const int &x)

{

x=10;

return ()

};

then     Functions

  • Option : A
  • Explanation : Here the function chg tries to change the parameter x, which is not allowed as it is declared to be a constant integer. So, the compiler gives an error.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *