Solved

Bitwise exclusive or

Posted on 2014-02-04
2
128 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
In this post we will learn different types of Android Layout and some basics of an Android App.
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

636 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