Answer to Question #329669 in C++ for shiv

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.


1
Expert's answer
2022-04-17T05:09:09-0400

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS