Ask your own question, for FREE!
Computer Science 23 Online
OpenStudy (anonymous):

After execution of the following code, what will be the value of input_value if the value 0 is entered at the keyboard at run time? cin >> input_value; if (input_value > 5) input_value = input_value + 5; else if (input_value > 2) input_value = input_value + 10; else input_value = input_value + 15;

OpenStudy (anonymous):

a. 5 b. 15 c. 10 d. 25 e. 0

OpenStudy (anonymous):

I ran it and got 0.. but I dont think that the right answer...

OpenStudy (anonymous):

should have been 15 right?

OpenStudy (anonymous):

thats what i think

OpenStudy (anonymous):

That's the output from the posted code. I just ran it. so what else did you have?

OpenStudy (anonymous):

Every time I run it I get zero.. but logic says its 15.. I'll go with logic.. Thanks!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!