Answer to Question #253271 in C++ for Colby

Question #253271

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


1
Expert's answer
2021-10-18T18:21:57-0400
#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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS