Free Pascal - conditional statement: if then, if then else

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, if then else

Description

if condition then statement1;
if condition then statement1 else statement2;
Used keywords: if else then

Input

Examples

Free Pascal

conditional statement the possible of use:
if i > 10 then
begin
i :=10;            i := i - 1;   inc(i);
end;
if i < 10 then i := 10 else i:=1;

Free Pascal

Other pieces of example codes:
while i>0 do
   if i=10 then
     break
   else 
   begin
     dec(i)
   end;
if  x >= 12 then
   while  y >= 0 do  
      dec(y);
if y<5 then
   y := y/ 3.14;    // y = 1.234
if x > 0 then // x == true
   x:=5;
if x>$abc then
  y := x / $a;    // y = 466
if x>10 then
  y := x / $a;   // y = 1
Languages: en hu cz sk