fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.  
  6.  
  7.  
  8. int rows, cols;
  9.  
  10. cout << "Enter the number of rows in rectangle - ";
  11. cin >> rows;
  12.  
  13. cout << "Enter the number of columns in rectangle - ";
  14. cin >> cols;
  15.  
  16.  
  17. cout << "Rectangle of dimensions " << rows << "*" << cols << endl;
  18.  
  19.  
  20. for( int i = 0; i < rows; i++ ) {
  21. for( int j = 0; j < cols; j++ ){
  22. cout << "* ";
  23. }
  24. cout<<endl;
  25. }
  26.  
  27. return 0;
  28. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
Enter the number of rows in rectangle - Enter the number of columns in rectangle - Rectangle of dimensions -167138456*32766