Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how does the for loop work actually..suppose for the
following program how it ll work plz explain to me
for(i=5;i>=0;i--)
prinf(i--);

Answer Posted / shikhar

The answer given by preshit is absolutely correct...Lets
see how ,we have >>>
for(i=5;i>=0;i--)
Now we can write this all as :

//start of program

STEP 1 : for(i=5;i>=0;)
{
STEP 2 : prinf(i--);
STEP 3 : i--;
}
//end of program

TT : now the loop will start with i=5
when control reaches printf it firstly executes its
internal statement i.e i-- and then prints i-1(i.e 4) and
it Reduces i by 1.i becomes 3
NOW once again STEP 1 :go to TT

OUTPUT :
4
2
0

Is This Answer Correct ?    2 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is #include stdio h?

1083


What is the concatenation operator?

1111


Is c call by value?

985


Why n++ execute faster than n+1 ?

2903


What is the size of structure in c?

1119


What does dm mean sexually?

1274


What is a const pointer in c?

1093


Define Array of pointers.

1069


write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays

2204


What is a structure in c language. how to initialise a structure in c?

1038


Explain what happens if you free a pointer twice?

1043


please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code

2151


Difference between Shallow copy and Deep copy?

1987


Are c and c++ the same?

1025


Explain what is page thrashing?

1068