If Statements:

A web programmer has different options for checking a condition and depending on the desired test will use either an "if statement" or an "if/else statement" or an "if/elseif" statement. This page gives the syntax for the "if statement" for both VB.NET and C#. Review the code below and view the interactive example. 

Check 1 condition: (Determines whether or not to respond)


If a web programmer only needs to check one condition an "if statement" can be used to test the results.

VB.NET code for the If Statement:

        
         If something has happened then
            'statement to execute
         End if
        
       

C# code for the If Statement:


      If (something has happened)
        {
           'statement to execute
        }
       
       





VB.NET vs. C#

Variables

Decisions

Built In Functions