FreeBASIC - conditional statement: if then end if, if then else end if

by conditions we can control our program. thanks conditional statement we can control program running in two directions. if the condition is satisfied to continue running the program in a first direction, if not as the second direction. under the directions of the programme I think either statement or block of statements.

if then end if, if then else end if

Description

if condition then
statements1
end if
if condition then
statements1
else
statements2
end if
Used keywords: if else then end

Input

Examples

FreeBASIC

conditional statement the possible of use:
if i > 10 then
i =10
            i = i - 1
   i=i+1
end if
if i < 10 then
 i = 10
 else
 i=1
end if

FreeBASIC

Other pieces of example codes:
do until i = 0
   if i=10 then
     exit do
   else
     i=i-1
   end if
loop
do while i>0
   if i=10 then
     exit do
   else
     i=i-1
   end if
loop
do
  i=i+1
  if i=3 then
    exit do
end if
loop until (i=10)
if x>5 then
  y = x / &Ha  ' y = 1
end if
if i - 10 >0 then
 i = i-5
end if
if  y > 32 then  
   c=true
end if
Languages: en hu cz sk