If x 3 then what will be the value of xafter executing the


Question1.Consider the following function definition.

int func(int x) {

int i = x ;

while (i <= 10 ){

cout << i ;

i++ ;

}

return i ;

}

If a value 5 is passed to the above function then whatwill be the return value of function?

Question No 2. 

How many times will the following while loop execute, ifwe the value of i = 5?

while (i >= 5 ){

cout << i ;

i++ ;

}

Question No3.  

switch(x){

case 1:

x += 1 ;

break ;

case 2:

x += 2 ;

case 3:

x += 3 ;

break ;

case 4:

x += 4 ;

break ;

default:

          x += 10;

}

a) If x = 2, then what will be the value of xafter executing the above switch statement?

b) If x = 3, then what will be the value of xafter executing the above switch statement?

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: If x 3 then what will be the value of xafter executing the
Reference No:- TGS0796759

Expected delivery within 24 Hours