Page 1 of 1

Re: About Question enthuware.ocajp.i.v7.2. 1090 :

Posted: Fri Jul 04, 2014 4:54 am
by Nisim123
It will be easier to say that it will not compile since j is not initialized :

Code: Select all

int sum = 0;
      for (int i = 0, j = 10; sum > 20; ++i, --j)      // 1
      {.........
I cannot say what prevents you from marking this option as a correct answer,
this compile time error comes before the boolean condition of the for statement.... :|

Re: About Question enthuware.ocajp.i.v7.2.1090 :

Posted: Fri Jul 04, 2014 5:04 am
by admin
Not sure what you mean. It compiles and runs fine.

Re: About Question enthuware.ocajp.i.v7.2.1090 :

Posted: Fri Jul 04, 2014 6:02 am
by Nisim123
Yes, well you are probably right. I was probably confused with the way int j is initialized inside the for loop's declaration...

:geek: