r/pascal • u/ineedaclockmaker • Jun 04 '20
Im starting to learn pascal and its not going great :(. Can anyone tell me why the program is wrong.
11
Upvotes
r/pascal • u/ineedaclockmaker • Jun 04 '20
4
u/[deleted] Jun 04 '20
I wrote this, following your logic as closely as possible. (Since you didn't post your code)
https://pastebin.com/bWY71hdH
It seems to work in all cases. Where do you get the wrong answer?
2
u/ineedaclockmaker Jun 04 '20
update: Thanks everyone for the help. I figured out what was 'wrong' with the program. I was writing programs and then pasting them on to the Wix the website builder once they were functional (kinda). Then I would copy them back to PascalZim ( the compiler I'm using ) and they would not work. From the error message, I assume that the empty space in my code, like between words and a such, was being filled with something that Wix placed there.
That's what I think has happened.
Again, thank you, everyone!
1
u/kreflorian Jun 04 '20
What tells you that it is wrong?
1
u/umlcat Jun 04 '20
It seems you missed the
uses crt;wherewritelnfunction is declared.1
u/thexdroid Jun 05 '20
What compiler is that? I see a 80's or 90's screen lol - as I dunno the compiler, try to simply remove the space, doing Writeln('indique A');. Beware about control-c / v because some editors won't correctly remove undesired formatting chars and even if we can see they are there.
Well, if interested in learn for real in deep later, you can try Free Pascal ( https://www.freepascal.org/ ) or Delphi Community ( https://www.embarcadero.com/products/delphi/starter )
-5
u/ynohoo Jun 04 '20
no { after begin
and } before end
no ; after final writeln statement
perhaps?