1. does anyone know pascal? because i'm having trouble running a program code i made. It won't load?

2. You should probably post the code you're using, and be more specific with your problem.

3. Post the code already. I know a bit of pascal.

4. alright relax dudes..

PROGRAM Expressions1(OUTPUT);
BEGIN
WRITELN;
WRITELN('A. 15 - 15 DIV 15 = ',15-15 DIV 15);
WRITELN('B. 22 + 10 / 2 = ', 22+10/2:0:2);
WRITELN('B. (22 + 10) / 2 = ', (22+10)/2:0:2);
WRITELN('C. 50 * 10 - 4 MOD 3 * 5 + 80 = ',50*10-4 MOD 3*5+80);
WRITELN('Press ENTER to continue..');
END.

my problem is getting the "RUN" function to do its job and display the output program of the code.

5. Originally Posted by thepretender
alright relax dudes..

PROGRAM Expressions1(OUTPUT);
BEGIN
WRITELN;
WRITELN('A. 15 - 15 DIV 15 = ',15-15 DIV 15);
WRITELN('B. 22 + 10 / 2 = ', 22+10/2:0:2);
WRITELN('B. (22 + 10) / 2 = ', (22+10)/2:0:2);
WRITELN('C. 50 * 10 - 4 MOD 3 * 5 + 80 = ',50*10-4 MOD 3*5+80);
WRITELN('Press ENTER to continue..');
END.

my problem is getting the "RUN" function to do its job and display the output program of the code.

I don't know what version of Pascal you are using. I am only guessing what you are trying to achieve not having seen the exercise question. If you look at the modified program below(MS-DOS Pascal 6) it might give you an idea where you have gone wrong.

PROGRAM Expressions1(OUTPUT);
BEGIN
WRITELN;
WRITE('A. (15 minus 15) divided by 15 = , ');
WRITELN((15-15)/15);
WRITE('B. (22 plus 10) divided by 2 = , ' );
WRITELN((22+10)/2);
WRITE('C. (50 multiplied by 10 minus 4) divided by 3 multiplied by 5 plus 80 = , ');
WRITELN(((50*10)-4) MOD ((3*5)+80));
WRITELN('Press ENTER to continue..');
END.

When doing calculations always do your first calculation inside brackets e.g(10+2). Then add your second calculation enclosing both calculations in brackets e.g.((10+2) * 6) otherwise Pascal will calculate in the following order: *,/,-,+ and that won't necessary give you the result that you originally wanted;

10+2 * 6 = 22.

((10+2) * 6) = 72

Good luck.

6. Yep.. its more neat and spread out. Thanks!

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•