Question #253271

How do you put the numbers in for the rows and columns?


Expert's answer

#include <iostream>
using namespace std;


int main()
{
    int rows;
    int columns;
    
    cout<<"\nEnter number of rows: ";
    cin>>rows;
    cout<<"\nEnter number of columns: ";
    cin>>columns;
    
    for(int i=0;i<rows;i++){
        for(int j=0;j<columns;j++){
            cout<<j<<" ";
        }
        cout<<'\n';
    }


    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS