Ask Question
18 January, 05:21

What will be the value of input_value if the value 5 is input 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;

+5
Answers (1)
  1. 18 January, 05:31
    0
    15

    Explanation:

    The if else state is used for checking the condition and if the condition is TRUE and program can execute the statement within the if else.

    Initially input_value is 5

    then the if statement check the condition 5>5, condition FALSE because 5==5

    it not less than 5.

    then program move to else if and check condition 5>2, condition TRUE.

    then, input_value = 5 + 10=15 execute and update the value to 15.

    After that, program terminate the if else statement.

    Therefore, the answer is 15.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “What will be the value of input_value if the value 5 is input at run time? cin >> input_value; if (input_value > 5) input_value = ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers