sexta-feira, 22 de março de 2013

Operators




Program B, asks the user for two numbers then performs an arithmetic operation, stores the result to the "res" variable and prints it out.

As you can see the variable's data type is real, this allows the program to recieve numbers with fractional parts, and print out an accurate result. The program will show the result in scientific notation, this can be removed by writing :0:0 next to res.

writeln('The result is equal to', res:0:0);



You should play around with this information for awhile, don't start using logical operators just yet, we'll leave those for Control Structures (module 3).

0 comentários

Posts a comment

 
© Doc's Workshop
Designed by Blog Thiết Kế
Back to top