What is difference between for and for each loop.

What is difference between for and for each loop.Please explain with a example.

Your Answer

a for loop is a construct that says "perform this operation n. times". a foreach loop is a construct that says "perform this operation against each value/object in this IEnumerable"

Html

Didn't get the answer.
Contact people of Talent-Html directly by clicking here