What will be the output of the following Visual Basic code, If the intnumber variable is 110? [code] If intnumber<=100 Then Intnumber=intnumb

Ngoc Hue

New member
What will be the output of the following Visual Basic code, If the intnumber variable is 110?
Code:
If intnumber<=100 Then
   Intnumber=intnumber*2;
Else
   Intnumber=intnumber*3;
EndIf
A. 156
B. 270
C. 180
D. 330
 
Answer: D
Explanation: Since the intnumber is 110, i.e. it is greater than 100, thus else part of the code will be executed, i.e., the if part of the code will not be executed. Thus intnumber=intnumber*3 will be executed, thus 110*3=330 will be stored in intnumber.
 

Tìm kiếm

Back
Top