answersLogoWhite

0


Best Answer

For while loop you have to define conditions for the loop in loop's body. In, "for loop" case it's more natural and comportable. For loop is good for numeric simulations in other words when you are using only numbers. Loop while is very good for symbolic conditions, for instance, to check the condition that char1 == char2;

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

In C++, a for loop allows you to (optionally) perform several operations in a single statement, including instantiating and initialising one or more variables, evaluating an expression before each iteration, and performing one or more operations at the end of each iteration. If the expression evaluates false, the loop terminates. Any variables instantiated within the for statement will fall from scope when the loop terminates.

A while loop only allows an expression to be evaluated at the start of each iteration. If the expression evaluates false, the loop terminates. Any variables used by the expression remain in scope when the loop terminates.

A do-while loop is similar to a while loop except the loop always executes at least once and the expression is evaluated at the end of each iteration, terminating the loop when it evaluates false.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between while loop and for loop in c computer language?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Difference between abacus and modern computer?

abacus is an ancient calculating tools while an computer is a modern tools.


What is the difference between a computer and an operating system?

a computer is a machine for performing caculations automatically while an operating system is a software that contrls the execution of a computer


What is the difference between computer structure and computer function?

i think computer structure is just a drawing of computer in a postal or book while computer function is just like the purpose of a computer.


What is difference between language and linguistics?

linguistics is the scientific study of human language while language is a different thing which tells us to speak , read or to write: in simple words language is a way of communication between persons.


What is the difference between microprocessor and computer?

a microprocessor is a small unit with memory inside the system unit while a computer is the combination of a monitor and a system unit


What is the difference between minoans and mycenaecn?

The Mycenaeans spoke a version of Greek language, written in a syllabary called Linear B while the Minoan language is unknown.


What is difference between typewriter computer?

One is only useful for writing papers and filling forms while computers are anything that "computes" such as a calculator or a desktop computer


What is one major difference between the African Union and the Community of Portuguese Language Countries?

One major difference is their membership composition. The African Union consists of African countries, while the Community of Portuguese Language Countries consists of countries where Portuguese is an official language, including countries outside of Africa.


Difference between instant messaging and text messaging?

Text messaging is on your ohone while instant messaging is in your computer (AIM)


What are the differences between a business letter and a private letter?

The difference between a business letter and a private letter is the type of language used. In a business letter, more formal language is used, while in a private letter, the language is more relaxed.


What is the difference between a computer program and a computer?


What the different between US and Belgium?

The difference between the US and Belgium is the language spoken. People in Belgium speak French, while in the US they speak English.