Monday, February 23, 2009

Doing calculations

Remember when doing calculations in C++, that multiply and divide takes priority above addition and subtraction.

Adding brackets according to these rules, makes it easier to underdstand, and it a neater way to code.

Remember that when you use the cout statement, do not use quotes around an arithmetic expressionas it will simply display the whole line.
Author : Linuxguru

0 nhận xét:

Post a Comment