Question #329669

What number will the following code snippet print

double x = 3.5; 
double y = 0;

if ( x <= 2 ){
   y = 1;
}
else if( x <= 4){
   y = 2;
} 
else {
   y = 3;
} 

x = y;
cout << "Number:" << x << endl;

Please provide the numerical value of x which is printed at the end. This question will only accept numbers as answers.


Expert's answer

2


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS