Monday, December 22, 2008

Arithmetic instruction

In an arithmetic instruction, a variable name is always remains in the left hand side of = and variable name(s) & constant(s) connected by arithmetic operators like +, –, * & /, lie on the left hand side of =.
Ex:
int d=7;
float pi,n=22.0;
pi=n/d;
Here,
Like /, +, –, * are also the arithmetic operators.

= is the assignment operator.
7 is an integer constant.
22.0 is a real constant.
d is an integer variable.
pi and n are real variables.
The variables and constants are collectively called ‘operands’, which are operated upon by the ‘arithmetic operator’  and the result is assigned using the ‘assignment operator’, to the variable on the left hand side.

No comments:

Post a Comment

Please give your valuable comments or queries if you fell its helpful or if you like the contents of the site. Thanks...