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.
2
Comments
Leave a comment