User Forum

Subject :NCO    Class : Class 9

What will be the value of variable Y after the successful execution of the given Visual Basic code?

Dim Y As Integer
Y = 9 / 2 + 2 - 1


A5
B6
C6.5
D7


Ans 1:

Class : Class 5
5

Ans 2:

Class : Class 8
A)5 as final result will be 5.5 but as you is integer the decimal will be omitted. For decimal you need double or float data type.

Ans 3:

Class : Class 9
5.5

Ans 4:

Class : Class 9
Answer will be A) 5

Ans 5:

Class : Class 9
6

Post Your Answer