int main()
{
int a=20;
int b=30;
int x;
x=(a
Output
B. If the condition is false
If the condition statement is false then expression2 will be executed and the value of the whole expression will be the value of expression2.
Output
Bitwise Operators in C
Bitwise Operators are used for manipulation of data at bit level. There are many four bitwise operators which are listed below are used for testing the bits or shifting them left or right.
Note : Bitwise operators cannot be applied to float or double data types.
Operator |
Meaning |
& |
bitwise AND |
| |
bitwise OR |
^ |
bitwise exclusive OR |
<< |
shift left |
>> |
shift right |
We will learn all about bitwise operator in details in upcoming topics.
Special Operators
C programming offers several special operators which makes C programming more attractive, the some important special operators are comma operator, sizeof operator, pointer operators ( * and & ) and member selection operators ( . and -> )
Operator |
Meaning |
, |
comma operator |
sizeof |
size of operator |
* and & |
pointer operator |
. and -> |
member selection operator |
Comma Operator
Comma operator is used to link several related expression together. See below example how we have implemented related expression together.
int a,b, c=10,d;
In above example we have declared four variables and they are similar types i.e. int type. We have declared all these variables together separated by comma operator (,) instead of typing in four lines.
sozeof Operator
The sizeof operator is used to determine the number of bytes occupied by the opened in run time. In general the opened are variables, constant or data type quantifier. See below examples.
Note : You will learn pointer operators (* and & ) and member selection operator ( . and -> ) later in upcomming chapters.