﻿ VB.NET Questions Answers-conditional statements (PartII)

# VB.NET Questions Answers-conditional statements (PartII)

## VB.NET conditional statements (PartII)

1. If originally x=2,y=3, and z=5, what is the value of x,y, and z after executing the following code?
If(x+1=y) then
y=y+1
Else x+=1
End If Check answer 2. If originally x=0,y=0, and z=1, what is the value of x,y, and z after executing the following code?
If(x) then
x-=1
y=x+2
Else : x+=1
End If Check answer 3. If originally x=2,y=0, and z=1, what is the value of x, y, and z after executing the following code?
If(x>y) then
y=x
Else : z=x
End If Check answer 4. If originally x=1,y=0, and z=1, what is the value of x, y, and z after executing the following code?
If(x>y And x>z) then
y=x
z=x+1
ElseIf(x+y>=z) then
x+=1
z=x+1
Else : y=z+x
End If Check answer 5. If originally x=1,y=2, and z=3, what is the value of x, y, and z after executing the following code?
Select case x
Case 0
x+=1
z=x+1
Case 1
y=z+x
Case Else: z=z+x
End Select Check answer