fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int i, j, n = 4; // number of rows
  5.  
  6. for(i = 1; i <= n; i++) {
  7. for(j = 1; j <= i; j++) {
  8. printf("%d ", i);
  9. }
  10. printf("\n");
  11. }
  12.  
  13. return 0;
  14. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
1 
2 2 
3 3 3 
4 4 4 4