Assigning values to variables
To assign values to the variables, assignment operator (=) is used.
Syntax of assigning values:
variable declaration;
Variable_name = value;
Example of assigning values:
Int i , j;
j = 5 ;
i = 0 ;
It is also possible to assign a value at the time of declaration.
e.g.
int i = 5;
More than one variable can be initialized in one statement using multiple assignment operators.
e.g. j = m = 2;
There could be an exception while using multiple assignment operators.
e.g. int i , j = 2 , k;
here the assignment will be i = 0 j=2 and k = garbage value
Bitwise operators
The smallest element in memory on which we are able to operate as yield is a byte; and we operate on it by use of the data type char Bitwise operator is used for manipulation of data at bit level.
These operators are used for testing the bits, shifting them right to left. Bitwise operator may not be applied to float or double data type.
This is a powerful feature of C to manipulate a bit. The programmer can access and manipulate individual bits within a piece of data.
Some of the bitwise operators in C are:
Operator Meaning
& Bitwise Logical AND
| Bitwise Logical OR
^ Bitwise Logical XOR
<< Left Shift
>> Right Shift
~ Once Compliment
The comma operators
This operator is used to link the related expression
together the expression is separated by the, operator.
Here firstly value 1 is assigned to a, followed by this
2 is assigned to b, and then the result of a+b is assigned to c.
The comma operator is often used in conjunction with
a
control statement called For. Technorati Profile