Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Bitwise exclusive or

Posted on 2014-02-04
2
Medium Priority
?
135 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 85

Accepted Solution

by:
ozo earned 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
The viewer will learn how to implement Singleton Design Pattern in Java.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

916 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