Ask Question
20 April, 15:09

Ar count = 10;

while (count>0)

{

count = count - 2;

}

What is the value of count after the code segment above is executed?

+4
Answers (1)
  1. 20 April, 16:28
    0
    The value of count after the code is executed is 0

    Explanation:

    According to the code initially the value of count is 10

    while (count>0)

    {

    count=count-2

    }

    means 10>0 condition is true

    count=10-2=8

    Again 8>0 condition of while loop is again true

    now count becomes=6

    This process repeated untill the condition of while loop is true

    and at last count becomes 0 the condition is false (0>0) so count becomes 0 after the code segment is executed
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Ar count = 10; while (count>0) { count = count - 2; } What is the value of count after the code segment above is executed? ...” 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