Ask Question
Today, 07:31

Ar count = 10;

while (count>0)

{

count = count - 2;

}

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

+3
Answers (1)
  1. Today, 10:12
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers