A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • 5 years ago

Can anybody clarified the used of an inner loop (in any programming language)?

  • This Question is Closed
  1. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    A nested loop is a logical structure used in computer programming where two repeating statements are placed in a "nested" form, i.e., one loop is situated within the body of the other. In a nested loop, the first iteration of the outer loop causes the inner loop to execute. The inner loop then repeats for as many times as is specified. When the inner loop completes, the outer loop is executed for its second iteration, triggering the inner loop again, and so on until the requirements for the outer loop are complete.

  2. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    for example outer loop goes through rows in 2D array (=rows of table) and inner loop goes through every index in each row (=cells in each rows)

  3. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    In any language and for any loop, the outer loop will run n times for \[1\le i \le n\]and the inner loop will execute \[\sum_{i}^{n} = n(n-1)/2\] times. A loop is nothing more than the union of a family of mutally disjoint sets. I hope this is the answer that you are looking for.

  4. carlsmith
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    It's like going round a race track, but on each lap of the main track, you have to turn onto another track and go round that a bunch of times. If you had to go round each of the tracks three times. You'd end up going round the main track three times and the inside track nine time, three times for each of the three laps round the main track. You can, in theory, nest as many loops inside one another as you like. Hope that helps.

  5. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.