Pascal <-> Basic | Feltételes utasítás

Pascal

if then, if then else

Leírás

if condition then statement1;
if condition then statement1 else statement2;
Használt kulcsszavak: if else then

Bemenet

Példaprogramok

Pascal

Feltételes utasítás lehetséges használata:
if i > 10 then
begin
i :=10;            i := i - 1;   inc(i);
end;
if i < 10 then i := 10 else i:=1;
.
Basic

if then end if, if then else end if

Leírás

if condition then
statements1
end if
if condition then
statements1
else
statements2
end if
Használt kulcsszavak: if else then end

Bemenet

Példaprogramok

Basic

Feltételes utasítás lehetséges használata:
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
Más nyelveken: en hu cz sk