Skip to content
Courses
DSA to Development
Get IBM Certification
Newly Launched!
Master Django Framework
Become AWS Certified
For Working Professionals
Interview 101: DSA & System Design
Data Science Training Program
JAVA Backend Development (Live)
DevOps Engineering (LIVE)
Data Structures & Algorithms in Python
For Students
Placement Preparation Course
Data Science (Live)
Data Structure & Algorithm-Self Paced (C++/JAVA)
Master Competitive Programming (Live)
Full Stack Development with React & Node JS (Live)
Full Stack Development
Data Science Program
All Courses
Tutorials
Data Structures & Algorithms
ML & Data Science
Interview Corner
Programming Languages
Web Development
CS Subjects
DevOps And Linux
School Learning
Practice
Build your AI Agent
GfG 160
Problem of the Day
Practice Coding Problems
GfG SDE Sheet
Contests
Accenture Hackathon (Ending Soon!)
GfG Weekly [Rated Contest]
Job-A-Thon Hiring Challenge
All Contests and Events
DSA
Practice Problems
Python
C
C++
Java
Courses
Machine Learning
DevOps
Web Development
System Design
Aptitude
Projects
Sign In
▲
Similar Topics
DSA
22.3k+ articles
Mathematical
7.7k+ articles
Arrays
6.4k+ articles
Strings
3.2k+ articles
Competitive Programming
2.3k+ articles
Algorithms
1.9k+ articles
Bitwise-XOR
430+ articles
Bitwise-AND
130+ articles
setBitCount
110+ articles
Bitwise-OR
110+ articles
DSA
>
Algorithms
>
Bit Magic
Bit Magic
1.2k+ posts
Popular Articles
Recent Articles
Bitwise Algorithms
Last Updated: 07 April 2025
Bitwise algorithms in Data Structures and Algorithms (DSA) involve manipulating individual bits of binary representations of numbers to perf
...read more
Bit Magic
DSA
BCD or Binary Coded Decimal
Last Updated: 27 March 2025
Binary Coded Decimal (BCD) is a binary encoding system in which each decimal digit is represented by a fixed number of binary bits, typicall
...read more
Bit Magic
Mathematical
Numbers
base-conversion
DSA
Set, Clear and Toggle a Given Bit of a Number in C
Last Updated: 12 August 2024
Write a C program to Set, Clear, and Toggle the given bit of a number.Setting a bit means that if Kth bit is 0, then set it to 1 and if it i
...read more
Bit Magic
C Programs
DSA
Similar Topics
DSA
22.3k+ articles
Mathematical
7.7k+ articles
Arrays
6.4k+ articles
Strings
3.2k+ articles
Competitive Programming
2.3k+ articles
Algorithms
1.9k+ articles
Bitwise-XOR
430+ articles
Bitwise-AND
130+ articles
setBitCount
110+ articles
Bitwise-OR
110+ articles
Divide two integers without using multiplication and division operator
Last Updated: 19 September 2024
Given two integers a and b, the task is to find the quotient after dividing a by b without using multiplication, division, and mod operator.
...read more
Bit Magic
DSA
Find most significant set bit of a number
Last Updated: 06 April 2023
Given a number, find the greatest number less than the given a number which is the power of two or find the most significant bit number .Exa
...read more
Bit Magic
DSA
Check whether K-th bit is set or not
Last Updated: 12 March 2025
Given a number n and a bit position k, check if the kth bit of n is set or not. A bit is called set if it is 1.Note: Indexing starts with 0
...read more
Strings
Bit Magic
Microsoft
DSA
Gray to Binary and Binary to Gray conversion
Last Updated: 03 February 2025
Binary Number is the default way to store numbers, but in many applications, binary numbers are difficult to use and a variety of binary num
...read more
Bit Magic
Mathematical
binary-representation
Bitwise-XOR
gray-code
DSA
Relational Operators in C
Last Updated: 23 January 2025
In C, relational operators are the symbols that are used for comparison between two values to understand the type of relationship a pair of
...read more
Bit Magic
cpp-operator
C Language
C-Operators
Operators
DSA
Bitwise Right Shift Operators in Java
Last Updated: 08 March 2023
In C/C++ there is only one right shift operator '' which should be used only for positive integers or unsigned integers. Use of the right sh
...read more
Bit Magic
Java
Java-Operators
DSA
Unique Number III
Last Updated: 21 April 2025
Given an array where every element occurs three times, except one element which occurs only once. Find the element that occurs once. Example
...read more
Arrays
Bit Magic
Microsoft
Amazon
Qualcomm
Ola Cabs
Mathematical
Bitwise-XOR
DSA
Count total set bits in first N Natural Numbers (all numbers from 1 to N)
Last Updated: 18 February 2025
Given a positive integer n, the task is to count the total number of set bits in binary representation of all natural numbers from 1 to n.Ex
...read more
Bit Magic
Amazon
DSA
Rotate bits of a number
Last Updated: 26 April 2025
Given a 32-bit integer n and an integer d, rotate the binary representation of n by d positions in both left and right directions. After eac
...read more
Bit Magic
rotation
DSA
Unique Numbers ||
Last Updated: 21 April 2025
Given an array arr[] containing 2*n + 2 positive numbers, out of which 2*n numbers exist in pairs whereas the other two number occur exactly
...read more
Bit Magic
Microsoft
Amazon
Google
Qualcomm
Accolite
MakeMyTrip
FactSet
Bitwise-XOR
DSA
Find the Number Occurring Odd Number of Times
Last Updated: 30 May 2024
Given an array of positive integers. All numbers occur an even number of times except one number which occurs an odd number of times. Find t
...read more
Arrays
Bit Magic
Amazon
Snapdeal
Hash
Bitwise-XOR
DSA
Position of rightmost set bit
Last Updated: 26 March 2025
Given an integer n, the task is to return the position of the first set bit from right to left in the binary representation n.If n is equal
...read more
Bit Magic
Amazon
DSA
First
1
2
3
4
5
6
7
8
>>
Last
First
1
2
3
4
5
6
>>
Last
First
1
2
3
4
>>
Last
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !