Advertisement
payjack

Class Notes 10/25 - Nested Loop

Oct 25th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. //nested for loops
  2. //10/25/17
  3.  
  4. #include <iostream>
  5. using namespace std;
  6.  
  7. int main ()
  8. {
  9.     for (int i = 0; i < 10; i++)
  10.     {
  11.         for (int j = 0; j<10; j++)
  12.         {
  13.  
  14.             cout<<"i and j are :"<<i<<","<<j<<endl;
  15.             }
  16.         }
  17.         //i++ scope error! because the loop is done, i only exists while we are in the brackets ... ^^
  18.         return 0;
  19.     }
  20. //look up what matrix math is :) and ask ernest
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement