Last modified on 26 November 2009, at 10:35

If then else

The "if then else" construct is a form of Conditional Statement that is most often used in Computer Programming. This statement is used in almost all modern programming languages. The basic structure of it is:

if condition is true then do x
else do y

Visual Basic example:

if x < 4 then
 y = z + x
 y = z
end if

Java Example:

if (x < 4){ 
 y = z + x;
 y = z;