04-If Statement

0
326

This Visual Basic tutorial is all about If Statement.

The If statement is a conditional logic branching in computer programming. It contains the true and false statement in a computer terminology.  The true statement evaluates a nonzero value while the false statement evaluates a zero value.

 

This conditional logic is not just for computer programming but this can be also used in your daily life without realizing you’re doing it.

For instance, if you know how to catch fish then you have something to eat for the day but if not, you will be hungry the whole day.
Here’s the example of if and else statement:

  1. Dim name as String
  2. name = "Kenjie"
  3.  
  4. If name= "kenjie" Then
  5. MessageBox.Show( "Name is Kenjie" )
  6. else
  7. MessageBox.Show( "Name is not Kenjie" )
  8. End If

 

Readers might read also:

 

 

 

Facebook Comments
(Visited 33 times, 1 visits today)

LEAVE A REPLY

Please enter your comment!
Please enter your name here