in Programming
258 views
3 votes
3 votes

in Programming
by
258 views

3 Comments

Very nice question!! :)

It will be 148.
1
1
explanation is appreciated :)
0
0
Coming soon :v

Will be too big.. please have patience to go through..
1
1

1 Answer

4 votes
4 votes
Best answer

I hope i could make this clear.

selected by

4 Comments

Thanks for your effort :).. i have a doubt that...

After initialization of loop we directly go in the loop body...so how i is decremented to 4(although it's a pre decrement instruction but before 1 rst iteration we haven't encountered the inc/dec statement..)

please help ...

0
0
Yes.. you are right that we don't do the increment/decrement operation directly after initialization. But we certainly do the condition checking after initialization right?

Here the pre decrement operation is given where the condition checking is usually written. As I said the control flow should be the same i.e. for(A;B;C) the flow is

A->B->body of the loop(if B is satisfied) ->C->B->....

Here C is empty. B has the pre decrement operation. So it will be executed after initialization.
2
2

thanks @ MiNiPanda  for your effort.. it really helped:)

0
0
Welcome gari :P good to hear it helped :)
1
1

Related questions