Advertisement
maya97

4

Dec 11th, 2019
2,674
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7.  
  8.  
  9. void mains()
  10. {
  11.     int arr[7][7];
  12.     arr[0][0] = 1;
  13.    
  14.     int i , j;
  15.     for(i=0 ; i<7 ; i++)
  16.    {
  17.        for(j=0 ; j<7 ; j++ )
  18.        {
  19.          
  20.            if(i<j)
  21.            {
  22.                arr[i][j] = i*j;
  23.            }
  24.            
  25.            else if (i>j)
  26.             {
  27.                 arr[i][j] = 0;
  28.             }
  29.            
  30.             else if(i=j)
  31.             {
  32.                 arr[i][j] = 1;
  33.             }
  34.         }
  35.     }
  36.    
  37.     for (int k = 0 ; k<7 ; k++)
  38.    {
  39.        for (int c = 0 ; c < 7 ; c++)
  40.        {
  41.            cout << arr[k][c] << "\t";
  42.        }
  43.        cout << "\n";
  44.        
  45.        
  46.        
  47.    }
  48.    
  49.  
  50. }
  51.  
  52.  
  53. int main()
  54. {
  55.    mains();
  56.    
  57.    
  58.     return 0;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement