Ask Question
26 July, 00:30

A and B have same output or not? A B x=0 x=0 do do x<3 x=x+1 x=x+1 print x print x while x<3 while

+3
Answers (1)
  1. 26 July, 00:53
    0
    A and B have different output:

    A output will be 1

    B output will be 123

    Explanation:

    A

    X = 0

    do x < 3

    x = x+1

    print x

    while

    B

    X = 0

    do x = x + 1

    print x

    while x < 3

    For statement A the condition statement which suppose to be after "while" is not set therefore the value of x will be printed.

    For statement B the condition statement is set "x < 3" in front of "while" thereby result in iteration until the condition is false.

    Statement A output will be 1

    Statement B output will be 123
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “A and B have same output or not? A B x=0 x=0 do do x ...” 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