answersLogoWhite

0

The nested loop.

User Avatar

Wiki User

11y ago

What else can I help you with?

Continue Learning about Engineering

What is the most basic loop in c?

Answerthe answer to this question would vary from programmer to programmer... Basically for the embedded system programmer the while loop is more important and would be considered as basic. However for the application programmer the for loop is always a better option.AnswerThese are: LABEL-goto, while, for, do-while, and recursion, of course.


How do you use a C-continue statement in a block- without any looping or conditional statements?

In the C language, the continue statement can only be used within a loop (for, while, or do). Upon execution, control transfers to the beginning of the loop.


Is embedded C an assembly language?

No.


When loops are nested does one loop have to end before the other begins?

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


How does loop work?

In programming, a loop works by conditionally jumping to the start of the loop and repeating the instructions. If the condition evaluates false, execution continues to the next instruction, thus breaking out of the loop. We can also break out of a loop from within the body of the loop itself using another conditional jump which jumps out of the loop. If we jump backwards out of a loop we effectively create an intertwined loop, known as spaghetti code which is difficult to read and maintain. Structured loops help make it easier to digest the logic. In C, a jump is achieved using a goto and a label. However, structured loops using for, while and do-while statements make loops much easier to read and maintain.

Related Questions

What is the definition of 'nested' in C programming?

In C a structure within a structure is called nested. For example, you can embed a while loop in another while loop or for loop in a for loop or an if statement in another if statement.


What is difference between select Case statement and nested loop in c programming in UNIX?

UNIX has no bearing on the C language; it is cross-platform. There is no select/case in C, you probably meant switch/case. However, a switch/case is a conditional jump while a nested loop is a loop within a loop. Besides the C language they have nothing in common with each other.


Which loop is also called an exit-condition loop in C programming?

The do while loop is also called an exit condition loop in c, c++, and java.


What is the most basic loop in c?

Answerthe answer to this question would vary from programmer to programmer... Basically for the embedded system programmer the while loop is more important and would be considered as basic. However for the application programmer the for loop is always a better option.AnswerThese are: LABEL-goto, while, for, do-while, and recursion, of course.


How do you use a C-continue statement in a block- without any looping or conditional statements?

In the C language, the continue statement can only be used within a loop (for, while, or do). Upon execution, control transfers to the beginning of the loop.


What is the order of precedence with regard to the operator used in embedded C program?

Operator precedence in embedded C is exactly the same as in standard C.


Why embedded systems in only c?

Embedded systems are made only in C as it provides efficient memory management independence


Is do while loop in c is exit controoled loop?

yes


Is embedded C an assembly language?

No.


What is odd loop in 'C' program?

odd loop means at least the loop execute once.


When loops are nested does one loop have to end before the other begins?

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


What is for looping in c language?

The for loop is another entry-controlled loop that provides a more concise loop control structure.The general form of the for loop isfor( initialization ; test condition ; increment ){body}Generally this loop is used when the either the no. of loops or the looping condition or the end condition is known.Ex.to count n no. of integers.Hope this will help.