The Gateway to Computer Science Excellence
+3 votes

in Programming by Active (3.5k points) | 99 views
Very nice question!! :)

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

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

1 Answer

+4 votes
Best answer

I hope i could make this clear.

by Boss (23.5k points)
selected by

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

After initialization of loop we directly go in the loop 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 ...

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.

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

Welcome gari :P good to hear it helped :)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,321 answers
105,156 users