开发者

What is the difference between loop and iteration? [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. 开发者_StackOverflow社区 Closed 10 years ago.

What kinds of data structure are used to implement loop and iteration?


Loop refers to the code... iteration refers to the process in which the content of loop is executed once.. so 1 iteration refers to 1 time execution of loop.. so basically one loop can undergo many iterations..


loop is used for fixed no. of element or certain condition occurs while iterator is used for itearing element dynamically that have different no. of elements at runtime


Only such of kind 1.

Some have tried using data structures of kind 42 for this purpose, but failed miserably.


Iteration is simply the number of time/times a loop can be executed, while loop is the code which generate or causes expressions to be iterated iteration when the loop is executing.

An example of lines of code in c++:

for(i=1; i<=10; i++)
   {
   cout<<"this is printed 10 times";
   }

The above code is a for_loop in which the execution of the statement "this is printed 10 times" will be iterated/repeated 10 times.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜