EXPRESSION

Your resource to C programming

In the last tutorial we saw how values are assigned to the variables and their types. However,their are types like unsigned,signed,short,long.Their values chages according to 16-bit and 32-bit mechines.
An unsigned int has greater value than signed int or float.

operators
/* program starts */
#include
main()
{
int a = 10;
int b=10;
unsigned int c ;
/*we have not assigned any values to c*/
/*expression */
c = a + b;
printf("%u",c);
}
/* program ends */

In the above program we have not assigned any value to the variable C. But , the value of c is replaced by an expression.That is.The value assigned to a and b combines to give value of c.Hence, we see how C language allows mathematical calculations using names. The figure below gives a clear picture how things work in memory.

From the figure it is clear that the new value actually get address in the memory and it is reserve for variablec.Here is a list of operators which is used in C programming.

+(plus)-(minus)
*(multiply)/(divide)
%(modulus)>(less than)
<(greater than)=>(less than equal to)
<=(greater than equal to)==(is equal to)
?(conditional)sizeof(gives bytes value)
&(address)&&(and)
||(or)++(increment)
--(decrement)!=(not equal to)
^(bitwise)>>(right shift)
<<(left shift)->(arrow)

Though at first it confuses everybody , the opertor table is an easy one. It need a little explanation ,but we will go one by one and cover everything in each lessons. apart from some basic arithmatics, C is able to do some complex operations with memory ,disk, file handling,search,etc.All by assigning values and reading values from screen. These ability makes C very strong .In the table above each operator have special place with regards to special data types.These data types are not fixed in side the program in runtime .They are subjected to changes as you decide and design programs.

End of Tutorial
Hosted by www.Geocities.ws

1