Ask Question
11 March, 05:33

What will be the value of x after the following code is executed? int x = 10; do { x * = 20; } while (x 5.

+4
Answers (2)
  1. 11 March, 07:46
    0
    It's B. 200 it's answer for x value
  2. 11 March, 08:51
    0
    Option B is the correct answer.

    Explanation:

    In the above code, the loop will execute only one time because the loop condition is false and it is the Do-While loop and the property of the Do-while loop is to execute on a single time if the loop condition is false. Then the statement "x*=20; " will execute one and gives the result 200 for x variable because this statement means "x=x*20". SO the 200 is the answer for the X variable which is described above and it is stated from option B. Hence it is the correct option while the other is not because- - Option A states that the value is 10 but the value is 200. Option C states that this is an infinite loop but the loop is executed one time. Option D states that the loop will not be executed but the loop is executed one time
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “What will be the value of x after the following code is executed? int x = 10; do { x * = 20; } while (x 5. ...” 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