Needing help with nested conditions

Hi! I've recently started learing pascal, and i was trying here to do a program that asks for the user to enter 3 numbers, calculate the biggest and the least ( > and < bad english) and print the results on the screen
this was my attempt:

[code]program mayorymenor;

var

num1 : integer;
num2 : integer;
num3 : integer;

begin

write ('introduzca el primer n

Comments

  • [b]else[/b] cannot be preceded by a semicolon, but there's more wrong with your code than that. Unless grouped together by [b]begin/end[/b], an [b]if[/b] acts on only a single statement. I have not studied your code in detail but I think this is what you want.

    [code]
    program mayorymenor;

    var
    num1 : integer;
    num2 : integer;
    num3 : integer;
    mayor : integer;
    menor : integer;

    begin
    write ('introduzca el primer n
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion