answersLogoWhite

0

If one loop ends before the next begins then they are not nested at all -- they are completely independent. To be nested, one loop must contain the other loop in its entirety. That is, the inner, nested loop must start and end within the outer, containing loop.

Nested loop example (in C++):

for( int x = 0; x < 10; ++x ) // outer loop

{

for( int y = 0; y < 10; ++y ) // inner loop (nested loop)

{

printf( "%d x %d = %d\r\n", x, y, x*y );

} // end of inner loop

} // end of outer loop

User Avatar

Wiki User

12y ago

What else can I help you with?

Continue Learning about Engineering

Why you use inner loop and outer loop?

Sometimes you have to use nested loops, in this case one of them is the outer, the other is the inner.


What is nesting in C programming?

Nesting can be a very handy tool in C++, but should be avoided if possible.C++ gives us If statements, For loops and many other things. These can be nested. For example:A nested If statement://outer if statementIf( this is true ){//nested if statementif( this is also true ){//do something}else{//do something else}}


Difference between ordered and unordered list?

unordered list: delineates a list, where the items are generally of equal importance and do not need to go in any particular order. Each item begins with a tag. Unordered lists may be nested inside unordered lists or inside any other types of lists (one list inside of another list inside of another list). A line space automatically is inserted before and after an unordered list (that is, an entire line is skipped between an unordered list and any text before and after it), except for (on most browsers) a list nested within another list.ordered list: delineates a list, where the items are in sequential, numerical order. Each item begins with a tag. Ordered lists may be nested inside ordered lists or inside any other types of lists (one list inside of another list inside of another list). A line space automatically is inserted before and after an ordered list (that is, an entire line is skipped between an ordered list and any text before and after it), except for (on most browsers) a list nested within another list.


What are tags between other tags called?

A tag located between other tags is called a nested tag.


Can tags be nested inside each other?

Yes, tags can be nested inside each other in various markup languages, such as HTML or XML. This allows for a hierarchical structure, enabling more complex layouts and data organization. However, it's important to follow the proper syntax and rules of the specific language to ensure that the nested tags are correctly understood and rendered. Improper nesting can lead to errors in how the content is displayed or processed.

Related Questions

Why you use inner loop and outer loop?

Sometimes you have to use nested loops, in this case one of them is the outer, the other is the inner.


What is nesting in C programming?

Nesting can be a very handy tool in C++, but should be avoided if possible.C++ gives us If statements, For loops and many other things. These can be nested. For example:A nested If statement://outer if statementIf( this is true ){//nested if statementif( this is also true ){//do something}else{//do something else}}


When cooking what does nested mean?

One inside the other.


What are nested buffers?

Nested buffers refer to a situation where a system has multiple levels of buffers or storage spaces within each other. This can create a hierarchy of buffers, with data passing through multiple stages of buffering before being processed. Nested buffers are commonly used in computing systems to help manage data flow and optimize performance.


Difference between ordered and unordered list?

unordered list: delineates a list, where the items are generally of equal importance and do not need to go in any particular order. Each item begins with a tag. Unordered lists may be nested inside unordered lists or inside any other types of lists (one list inside of another list inside of another list). A line space automatically is inserted before and after an unordered list (that is, an entire line is skipped between an unordered list and any text before and after it), except for (on most browsers) a list nested within another list.ordered list: delineates a list, where the items are in sequential, numerical order. Each item begins with a tag. Ordered lists may be nested inside ordered lists or inside any other types of lists (one list inside of another list inside of another list). A line space automatically is inserted before and after an ordered list (that is, an entire line is skipped between an ordered list and any text before and after it), except for (on most browsers) a list nested within another list.


What are tags between other tags called?

A tag located between other tags is called a nested tag.


What are grouping symbols and what role do they play in the order of operations on mathematics?

Grouping symbols are parentheses such as {}, (), []. They need to be evaluated before other operations. If there are a number of nested parentheses, they must be evaluated starting with the innermost.


What is a nested triangle in math?

It is a triangle inside another shape, usually such that its vertices are on the boundaries of the other shape.


Can tags be nested inside each other?

Yes, tags can be nested inside each other in various markup languages, such as HTML or XML. This allows for a hierarchical structure, enabling more complex layouts and data organization. However, it's important to follow the proper syntax and rules of the specific language to ensure that the nested tags are correctly understood and rendered. Improper nesting can lead to errors in how the content is displayed or processed.


What does the term nesting mean?

"Nesting" can mean a couple of things:the habit of a bird or animal to build a home which is called a nestto fit a smaller object into a larger one.In mathematical or computer terms: It means to place the same function within a like function. For instance:for (int x = 0; x < 5; x++){for (int y = 0; y < 10; y++){for (int z = 0; z < 15; z++){cout


What are many loops of wire placed one on top of the other?

Coil :)


What is looping in programming languages?

In programming, a "loop" is a piece of code that is allowed to execute repeatedly until a condition is met. Under C, there are "for" and "while" loops. Other languages have "foreach" and "repeat..until" loops. A "for" loop optionally sets a variable at a certain value, and then executes a block of code while that (and perhaps other variables) meet(s) certain conditions. "While" loops are simpler types of loops since they only loop while a condition is met - variables are set before the "while" statement. See the related links below for more information on looping in C.