The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
62 views

 

asked in Programming by (435 points) | 62 views
0
92?
0
Bro the answer given is 100
0
Kindly share your approach
0
Values printed will be 23+20+17+14+11+8+5+2=100 I think.
0
Yes ans is 100 and this question is a duplicate.
0

  Yes bro. What is your approach?

0
See, working of for() function will be like first going to initialization ,then it goes to checking condition and the goes inside the loop. Then again it goes to third condition and then checks again and goes to inside the for loop.

Now,when fun() is called at time of initialization it return 25 and decrements to 24. then in checking condition it returns 24 decrements to 23, then it prints 23 and decrements to 22.

Like this it will work until the condition is satisfied.
0
Still answer we get is not 100. It has to skip the third condition to get 100.
0
Thanks man

Please log in or register to answer this question.

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
48,756 questions
52,850 answers
183,548 comments
68,743 users