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

Diff between for loop and while loop?

Answer Posted / naresh lingampally

In both the loops the Out put is same.... but the compile
structure is different:

i.e..,
syn: for(i=0;i<=10;i++)
{
statement;
}

while(i<=10)
{
statement;
i++;
} .

i=0; --> initialization.---{1)
i<=10;---> conditioning ---(2)
i++; ---> incrementation ---(3)


in (while) the compiler order would be
(1) .. not along with the loop
(2),(3) in the loop

but in (for) the order is (1),(2),(3) in a single statement.

NOTE: MAJOR DIFFERENCE IS WE CAN REDUCE THE LENGTH OF THE
PROGRAM (FOR) NAD IS MORE SOPHISTICATED.

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is use of pointer?

1088


What are the different file extensions involved when programming in C?

1280


When would you use a pointer to a function?

1047


How many keywords (reserve words) are in c?

1142


Why does the call char scanf work?

1206


What does static variable mean in c?

1108


What is difference between structure and union in c programming?

1109


How can I sort more data than will fit in memory?

1112


What are directives in c?

974


How is a structure member accessed?

1132


Who invented bcpl language?

1196


How many types of operators are there in c?

1039


Explain modulus operator.

1057


PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM

2185


please explain every phase in the "SDLC" in the dotnet.

2619