The Gateway to Computer Science Excellence
+3 votes
99 views

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

It will be 148.
0
explanation is appreciated :)
+1
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
0

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 ...

+2
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.
0

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

+1
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
198,400 comments
105,153 users