program variables_constants; uses crt; {------------------------------------------------------------------------- This program demonstrates all the different types of variables, constants, and how output is spaced on the screen --------------------------------------------------------------------------} CONST hello = 'hello!'; error = 'You made an error!'; VAR age:real; years:real; number:integer; answer:real; begin clrscr; textcolor (2) ; writeln ( hello:1 ); writeln ( hello:2 ); writeln ( hello:3 ); writeln ( hello:4 ); writeln ( hello:5 ); writeln ( hello:6 ); writeln ( hello:7 ); writeln ( hello:8 ); writeln ( hello:9 ); writeln ('John' :4) ; writeln ('John' :5) ; writeln ('John' :6) ; writeln ('John' :7) ; writeln ('John' :8) ; writeln ('John' :9) ; writeln ('John' :10) ; writeln ('John' :11) ; writeln ('John' :12) ; writeln ('John' :13) ; {: and number tells how many spaces to give message} writeln; write ('ggfd '); write ('Please input your age ----> '); readln (age) ; years := 100 - age ; writeln ('You will be 100 in ',years:0:0,' years'); { := assigns a value to a variable, all real # in SN When formatting real#, first reserves spaces, second reserves decimal places} writeln; textcolor (3) ; writeln('Please enter an integer --->'); readln( number ); writeln; writeln ('We''re going to divide that number by 7'); answer:=number /7 ; writeln (answer) ; writeln; textcolor(25); writeln (error); readln; end.