fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int numRows = 4;
  6. int numCols = 6;
  7.  
  8. for (int i = 1; i <= numRows; ++i) {
  9. // Print asterisks
  10. for (int j = 1; j <= numCols; ++j) {
  11. cout << "* ";
  12. }
  13. cout << endl;
  14. }
  15.  
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0.01s 5276KB
stdin
Standard input is empty
stdout
* * * * * * 
* * * * * * 
* * * * * * 
* * * * * *