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.

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.