|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (7 bit)
|
Ok, I'm quite new with Pascal. I had some basic Pascal lessons in school, but I want to learn more about it. One thing I don't get the hang of is the use of labels. I just don't know how I should insert them into my progs. and how to use the GOTO command with them.
|
|
|
|
|
|
#2 |
|
Registered User
Join Date: Nov 2001
Posts: 1,965
|
Code:
program labeltest;
label 100;
var
i , n : integer;
x : real;
begin
readln(n);
for i := 1 to n do
begin
readln(x);
if ( x < 0) then
goto 100;
writeln( sqr(x) );
end;
100:
end.
Last edited by aym; 03-24-2002 at 12:10 PM. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|