WHILE block syntax
Publié : sam. févr. 09, 2019 3:29 pm
Hello, the WHILE block syntax is as follows.
But these two combinations do not work
Code : Tout sélectionner
function while_example_()
begin
local n;
assume( n, integer );
DispG; ClrIO; ClrGraph;
n:=1;
while (n <= 5)
do
printf( string(n) );
n := n + 1;
end
return Done;
end;
function while_example_1()
begin
local n;
assume( n, integer );
DispG; ClrIO; ClrGraph;
n:=1;
while (n <= 5)
begin
printf( string(n) );
n := n + 1;
end
return Done;
end;
function while_example_2()
{
local n;
assume( n, integer );
DispG; ClrIO; ClrGraph;
n:=1;
while (n <= 5)
{
printf( string(n) );
n := n + 1;
}
return Done;
};
function while_example_3()
begin
local n;
assume( n, integer );
DispG; ClrIO; ClrGraph;
n:=1;
while (n <= 5)
begin
printf( string(n) );
n := n + 1;
end_while
return Done;
end;
Code : Tout sélectionner
function while_example_4()
begin
local n;
assume( n, integer );
DispG; ClrIO; ClrGraph;
n:=1;
while (n <= 5)
do
printf( string(n) );
n := n + 1;
end_while
return Done;
end;
function while_example_5()
begin
local n;
assume( n, integer );
DispG; ClrIO; ClrGraph;
n:=1;
while (n <= 5)
printf( string(n) );
n := n + 1;
end_while
return Done;
end;