Ask Question

Look at each of the following code segments. What value will the If ... Then ... Else statements store in the variable intY?

a. intX = 0If intX < 1 ThenintY = 99Else intY = 0End Ifb. intX = 100If intX < = 1 ThenintY = 99ElseintY = 0End Ifc. intX = 0If intX 1 ThenintY = 99Else intY = 0End If

+1
Answers (1)
  1. 29 August, 10:25
    0
    a. Y=99

    b. Y=0

    c. Y=99

    Explanation:

    There are 3 if Then else statements

    for a.

    X=0 it is less than 0 hence if will be executed so Y=99.

    for b.

    X=100 since X is not less than or equal to 1 so else will be executed Y will be 0.

    For c.

    X=0 since it is not equal to 1 hence if will be executed hence the answer is Y=99.

    The operator is for not equal to.
Know the Answer?