Infinite or Infinite Not...... 2

Please Try Infinite or Infinite Not...... before solving this ... This is a snippet of code construct in java which gives a simple output :-----

CODE FOLLOWS int k=1; for( ; k>0 ; k++){

} System.out.println(k);

CODE ENDS ABOVE The answer to the question is the first three digits of the value printed i.e. the final value of 'k'. Note : Its a good question so please do not spoil its fun by using a computer to solve it.Have fun... Note: If you think answer is infinity then enter "0" as the answer.


The answer is -214.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

The max value of int type is 2147483647 but due to the condition k>0 k=_2147483647 and answer i.e. 1st 3 digits =-214

Kartikay Shandil
Jul 13, 2014

The reasoning to this questions answer can be found in the solutions section of the question Infinite or Infinite Not.... here

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...