1.

Suppose you are given two integers X and N. Using bitwise operators: i. Check the Nth bit of the integer X if it is 0 or 1. ii. Set the Nth bit of integer X i.e. make it 1.

Answer» INPUT number from USER. Store it in some variable say num .Input the BIT position from user. Store it in some variable say n .To get the nth bit of num RIGHT shift num , n times. Then perform bitwise AND with 1 i.e. bitStatus = (num >> n) & 1; .Explanation:plz mark me as brainliest


Discussion

No Comment Found