How do you put the numbers in for the rows and columns?
#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;
}
Comments
Leave a comment