Free Pascal <-> C++ | Podmíněný příkaz

Free Pascal

if then, if then else

Popis

if condition then statement1;
if condition then statement1 else statement2;
Použitá klíčová slova: if else then

Vstup

Příklady

Free Pascal

Možné použití Podmíněný příkaz:
if i > 10 then
begin
i :=10;            i := i - 1;   inc(i);
end;
if i < 10 then i := 10 else i:=1;
.
C++

if, if else

Popis

if (condition) statement1
if (condition) statement1 else statement2
Použitá klíčová slova: if else

Vstup

Příklady

C++

Možné použití Podmíněný příkaz:
if (i > 10)
{
i =10;            i = i - 1;   i++;
}
if (i < 10) i = 10; else i=1;
V jiných jazycích: en hu cz sk