answersLogoWhite

0


Best Answer

a for loop is defined with an boolean expression to indicate when it should terminate. A for each loop iterates once for each item in a collection.

for example, "for each (book in bookshelf)" will iterate once for each book on the bookshelf, providing access to the current book.

a for loop is defined like "for (int i = 0; i<10;i++)" meaning the loop will iterate as long as the condition is true (i < 10), and will increment on each loop.

Note: there is no 'for each' loop in C language, but there is a 'foreach' in PHP.

User Avatar

Wiki User

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

Wiki User

11y ago

repetition: while, for and do-while are loops, if-else is not.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between for if-then and for loop?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the difference between a loop and a whorl fingerprint?

That a loop is curved and a whorl is shaped like a wave.


What is the difference between a do while loop and a for loop in c?

the counter variable cannot be initialized in while loop before entering into the block.


What is the difference between a loop pedal and a delay pedal?

A Loop pedals recorded sound does not fade (decay).


What are the difference between a wire loop and a wire needle?

ewan ko


Open loop and close loop system in injection moluld machine?

loop checking is perform before cable termination..the difference between a close loop and open loop is,tha close loop has a feedback while the open loop has not.


What is difference in close loop and an open-loop control?

no difference that's the difference


What is the difference between while loop and for loop in oracle?

You mean PL/SQL? Well, they are different things, read the manual for details.


Is a while loop or a for loop faster?

No difference.


What the difference between pretest loop and posttest loops?

The difference is that pre means before and post means after in Latin so it's tested before or after. :)


Difference between for and while loop not in syntactically?

Well 'while' goes like this: while (condition) statement 'for': for (initialize; condition; after-each-loop) statement


What is the Difference between while and do while?

Both are programming commands. A do/while loop will execute at least once. A while loop may not execute at all.


What is the difference between for-loop container and foreach-loop container in ssis?

foreach loop executes a predetermined number of times eg. list of items, rows in a table, etc. a for loop executes until a certain condition is met