10. If originally x = 0, y = 0, and z = 1, what is the value ofx, y, andz after executing the following code?
if(x) ther
x=1
y=X+2
Else X+=1
End If
Answer:
11. If originally x = 0, y = 0, and z = 1, what is the value of x, y, and z after executing the fol owing code?
If(x) then
y=x+2
Else: X-*=1
End
Answer:
Answers
Answered by
0
Concept:
In the if statement, the program examines the test expression and only executes the statement(s) if the test expression returns True. The statement(s) are not executed if the test expression is False.
Given:
Find:
Find the values of x, y, and z after executing the program.
Solution:
10) (given)
The first statement will return False as .
Therefore, 'else' part will get executed.
Answer:
11) Now updated values are
The first statement will return True as .
Therefore, 'if then' part will get executed.
Answer:
Similar questions
English,
2 months ago
Physics,
2 months ago
Environmental Sciences,
2 months ago
Environmental Sciences,
5 months ago
Math,
5 months ago
Economy,
10 months ago