Solved

Bitwise exclusive or

Posted on 2014-02-04
2
121 Views
Last Modified: 2014-02-04
Hi:

A simple Java questions:

Please provide code to calculate 2^(3^(4^(5^6)))

Thanks

Sunnybrad
0
Comment
Question by:sunnybrad
2 Comments
 
LVL 84

Accepted Solution

by:
ozo earned 500 total points
ID: 39833814
System.out.println(2^3^4^5^6);
0
 
LVL 15

Expert Comment

by:gplana
ID: 39833838
I guess the ^ operator means and-bit operator. Try this code:

public class test{
    public static void main(String[] args){
      System.out.println(2&(3&(4&(5&6))));
   }
}

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now