a program in C language that  perform bitwise right shift >> operation.

Output: Enter any number:
10
Result after bitwise >> operation n>>2 is: 2

Explanation In the above example, we define integer variables n and res to store decimal value in the main() function.
We then asked the user to "Enter any number:" and accepted the value into variable n using scanf(). We assign the value to res after applying the appropriate shift operation . That is, the bitwise right shift operator shifts the bits of a to the right by 2 positions.
The binary representation of 10 (1010) is shifted two positions to the right, resulting in 2. So, the result in this case is 2, which is stored in the integer variable res.
Next, we use a printf() statement to display the result on the console along with the message 'Result after bitwise >> operation n>>2 is: %d' where %d is a placeholder for the value of res.
The program exits with an exit status of 0, indicating completion without errors.
Note that the right shift operation effectively divides the value of variable n by 2 , resulting in 2.


1.Write a program to add two numbers using the '+' operator.
2.Write a program in C to subtract two numbers using the '-' operator.
3.Write a program in C to multiply two numbers using the '*' operator.
4.Write a program to divide two numbers using the '/' operator.
5.Write a program in C to find the remainder of two numbers using the '%' operator.
6.Implement a program in C to perform bitwise AND on two numbers using the '&' operator.
7.Write a program in C to perform bitwise OR on two numbers using the '|' operator.
8.Write a program to perform bitwise XOR on two numbers using the '^' operator.
9.Write a program in C to perform bitwise left shift on a number using the '<<' operator.
11.Write a program to in C check if a number is even or odd using the bitwise AND operator.
12.Write a program in C to swap two numbers without using a temporary variable.
13.Write a program in C to find the minimum of two numbers without using the 'if' statement.
14. Write a program in C to check if a number is negative without using the 'if' statement.
15. Write a program in C to toggle a particular bit in a number using bitwise XOR.

Other Topic:-->>Nested While Loop. || conditional statements Assignments in C.