Computer Science, asked by myasser96333, 7 months ago

What must the initialization be so that the following fragment prints out the integers -3 -2 -1?
for( ; j<0 ;j++)
System.out.print( j + " ");
System.out.print();

Answers

Answered by anishasa
0

initialize j = -3

int j = -3  -3<0  condition True

j value printed j = -3

Then j gets incremented ...

- 2 < 0

And it goes on untill 0 < 0

Similar questions