1,105,221 Community Members

pascal problem

Member Avatar
kalo150
Newbie Poster
4 posts since Dec 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
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.
Member Avatar
pritaeas
mod_pritaeas
11,291 posts since Jul 2006
Reputation Points: 1,420 [?]
Q&As Helped to Solve: 1,832 [?]
Skill Endorsements: 155 [?]
Moderator
Featured
Sponsor
 
0
 

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

Member Avatar
riki.kavadarci
Newbie Poster
4 posts since Jun 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
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 three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: