• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Can you guess the output of this program ?

 
Bartender
Posts: 2290
95
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The puzzle is simple,
You have a program, you have to guess the output of this program, its not as simple as it looks.




You may use paper or calc, etc. If you want to know whats the right answer or you want to cheat, just run this program

All the best
 
salvin francis
Bartender
Posts: 2290
95
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for those requiring help:


Math.pow(x,y);
x to the power of y:
eg: Math.pow(2,3) = 2 to the power of 3 = 8
---------------------

x^y
This is called XORing, refer to XOR
eg: 12^23=27
---------------------


int x = a + b++;

is equivalent to

int x = a + b;
b = b + 1;
---------------------


post here for any more assistance...

 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!