Answer to Question #288016 in C++ for Fisiwe

Question #288016

What the value will Newval have after this code has been executed?

Int var1 = 4;

Int var2 = 10;

Int Newval = 0;

If (var1 * 2 >=var2)

newval = 5 + 2 * var2;

Else if (var1 < var2)

newval = var2 - var1 * 2;

Else

newval = var1;








1
Expert's answer
2022-01-16T17:51:16-0500

As var1 < var2 the value of newvar will be equal var2 - 2*var1, or 10 - 2*4 , that is 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