To work with FOR …. TO statements
Step 1
Description:
The FOR statement is a looping construct designed specifically for count-controlled loops.
Declaration:
FOR variable identifier:= Expressionl TO Expression2 DO
Statement 1;
Statement 2;
Example:
for number:=4 to 9 do
begin
sqnumber:=number*number;
Writeln(number,' ',sqnumber)
End
No comments:
Post a Comment