1.11M Members

pascal problem

 
1
 

it gives me an error and the code is:

var a,b,c:integer;
begin
write('a=');readln(a);
write('b=');readln(b);
write('c=');readln(c);
if a>b then
begin
if a>c then
writeln('a=',a)
else
writeln('c=',c);
end;
else
begin
if b>c then
writeln('b=',b)
else
writeln('c=',c);
end;
readln;
end.
 
0
 

The end before the else is not allowed to have a semi-colon. Next time post your error message too.

 
0
 

12 end;
13 else
14 begin
Notvalid
end;
; Not valid

Valid code
....
Do something

**If *statement       

then begin

Here Code if statement satisfied
.....

End else begin

Here Code if statement not satisfied
.....

end;

// You must ending this cicle with end;

...
end.

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: