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

Differentiate between #include<...> and #include '...'

1116


What is an auto variable in c?

1294


‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.

2389


write a programming in c to find the sum of all elements in an array through function.

2221


There seem to be a few missing operators ..

1096


any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()

1171


What is variables in c?

1096


What does the error 'Null Pointer Assignment' mean and what causes this error?

1259


The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?

1264


How do I read the arrow keys? What about function keys?

1150


What is Dynamic memory allocation in C? Name the dynamic allocation functions.

1481


When should the volatile modifier be used?

1237


What is the purpose of 'register' keyword?

1134


What is the return type of sizeof?

1114


Why can’t we compare structures?

1325