MCQs
We have passed three values and it will manipulate according to the given condition and yield
the result as 2 15
Output:
$ g++ arg.cpp
$ a.out
2 15
As void is not having any return value, it will not return the value to the caller.
The value of a has been changed to 7, So it returns as 13.
Output:
$ g++ arg1.cpp
$ a.out
13
We have increased the x value in operand as x+1, so it will return as 110.
Output:
$ g++ arg2.cpp
$ a.out
110
As we have given in the function as a+1, it will exceed the size and so it arises the segmentation fault.
Output:
$ g++ arg3.cpp
$ a.out
segmentation fault
As we passed by reference, the value is changed and it is returned as 20.
Output:
$ g++ arg5.cpp
$ a.out
20
None.
Because we multiplied the values by 2 in the copy function.
Output:
$ g++ arg6.cpp
$ a.out
x = 2,y = 6,z = 14
There are three ways of passing a parameter. They are pass by value,pass by reference and
pass by pointer.
Because const will not change the value of the variables during the execution.