Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

How to use if in Visual Basic?

+7 votes
asked Feb 2, 2023 by Park Jiho [Student] (190 points)
I want to make code getting BMI and if it is normal, overweight, or underweight.

1 Answer

0 votes
answered Feb 3, 2023 by Peter Minarik (82,920 points)

Here's a small example of deciding if a number is even or odd using the If statement in Visual Basic. For more details, please read here.

Module VBModule
    Sub Main()
        Dim a As Integer = 4
        If a Mod 2 = 0 Then
            Console.WriteLine("a is even")
            Console.WriteLine("a is odd")
        End If
        Console.WriteLine("Hello World")
    End Sub
End Module

Good luck!

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.