Java Program to Swap Two Numbers using Bitwise XOR Operation

This is a Java Program to Swap the Contents of two Numbers using Bitwise XOR Operation. Enter any two integer number as input. After that we first find bitwise XOR of first and second variables and store it in first variable. Now again we perform bitwise XOR operation of the same variables and store it … Read more

advertisement

Java Program to Check if Bit Position is Set to One or not

This is a Java Program to Check if a given Bit Position is set to One or not. Enter any decimal number as an input. Also mention the bit position at which you want to check whether one is present or not. After that we first convert the given decimal number into binary number and … Read more

advertisement

Java Program to Count Set Bits using Bitwise Operations

This is a Java Program to Count the Number of Bits set to One. Enter any decimal number as an input. After that we first convert the given decimal number into binary number and then check at every position for 1. If 1 occurs then we increase the counter by one. Hence at last we … Read more

advertisement

Bitwise Operators in Java

This is a Java Program to Illustrate the Use of Various Bitwise Operators. Enter any two decimal numbers as an input. After that select any option from different available options to perform various biwise operations and get the desired output. Here is the source code of the Java Program to Illustrate the Use of Various … Read more

advertisement

Java Program to Multiply Number by 4 using Bitwise Operators

This is a Java Program to Multiply given Number by 4 using Bitwise Operators. Enter the number you wish to multiply as input. After that we use left shift by 2 to multiply given input by four and hence get the output. Here is the source code of the Java Program to Multiply given Number … Read more

advertisement

Java Program to Perform Addition Operation using Bitwise Operators

This is the java program to perform addition of two numbers without using any arithmetic operators. The summation of two numbers can be obtained using XOR operation and carry can be obtained using AND performed at bit level. Here is the source code of the Java Program to Perform Addition Operation Using Bit-wise Operators. The … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.