pascal beginners

February 4, 2011 at 05:04:30
Specs: Windows XP
i start with pascal
but i never get true to make a simple program
this was my first program
i copy a lot of programs from the net put non never work please help me start .....
Program Lesson1_Program3;
Num1, Num2, Sum : Integer;

Begin {no semicolon}
Write('Input number 1:');
Writeln('Input number 2:');
Sum := Num1 + Num2; {addition}

thanks you

See More: pascal beginners

Report •

February 4, 2011 at 05:22:48
Remove the items in braces ({no semicolon} and {addition}) and try again.

Report •

February 4, 2011 at 06:32:55
U dont have to remove that, it jsut work as a comment and it isnt "read" by the coompilator

IMO the code is fine, Iwould most likely put the Vars in the same line as u have written Var, though . BTw, if u use a good compilator, it will write u wheres the problem and what he doesnt like and on which lane it is

Report •

February 4, 2011 at 07:28:16
It depends upon the Pascal compiler being used. Early compilers didn't recognize the { } style of comments but only (* *). As you say, the program looks fine, but apparently it is not working - a first attempt at a solution is to remove the comments and see if that makes any difference. It may, or it may not, but it's worth trying.

It would also be useful to know in which way the program is failing. Does it give compiler errors or is it just not giving the expected output?

Report •

Related Solutions

February 4, 2011 at 08:10:44
i used free pascal iDE BUT STILL not workin
can you friends send me a link to download a good and understandable compiler

Report •

February 4, 2011 at 09:37:27
Tell us how it's not working. What messages do you get?

Report •

Ask Question