ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    1. Topics
    2. Tags
    3. loops
    Log in to post
    • All categories
    • scottalanmillerS

      What is a For Loop

      Developer Discussion
      • loops bash • • scottalanmiller
      21
      3
      Votes
      21
      Posts
      1.9k
      Views

      ObsolesceO

      I did some experimenting... but it's not always the case, it depends on what you are doing. But doing this with simple counting results:

      b3b9a87e-cb8d-4e6f-8edb-dd29ffc719b2-image.png

      And for fun lol....

      eb24b287-1c66-4c93-8949-85d9f083eab7-image.png

    • lanceL

      C++ Creating a for loop to output a multiple multi-dimensional arrays.

      Developer Discussion
      • c++ arrays multi-demensional loops for • • lance
      2
      0
      Votes
      2
      Posts
      1.4k
      Views

      lanceL

      I ended up finding that if I add another for statement and nested in the first for loop and then cout some blank spaces I was able to achieve what I was looking to do. Below is what I had to do.

      for(i = 0; i < num_rows; i++) { for(j = 0; j < num_cols_1; j++) { // print j'th element in i'th row of array 1 } // print some spaces for(j = 0; j < num_cols_2; j++) { // print j'th element in i'th row of array 2 } }
    • 1 / 1