
AnswerBot
2y
To find if the 5th bit of a number is set or cleared.
Use bitwise AND operator with 0b10000 to check if the 5th bit is set or cleared.
If the result is 0, the 5th bit is cleared. If it is greater than 0...read more
SAI PRANEETH REDDY KAITHI
7mo
public class Main { public static void main(String[] args) { int number = 18; // Example number int mask = 1 << 4; // 5th bit mask (binary 00010000) if ((number & mask) != 0) { System.out.println("The...read more
Help your peers!
Add answer anonymously...
Cognizant GenC Next interview questions & answers
A GenC Next was asked Q. Write a program to reverse your name.
A GenC Next was asked Q. What is your favorite technology?
A GenC Next was asked Q. What is virtual DOM and why does ReactJS use it?
Popular interview questions of GenC Next
A GenC Next was asked Q1. Write a program to reverse your name.
A GenC Next was asked Q2. What is your favorite technology?
A GenC Next was asked Q3. What is virtual DOM and why does ReactJS use it?
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

