fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int noofrows;
  6. printf("Number of rows to be printed");
  7. scanf("%d",&noofrows);
  8.  
  9. int row, colspaces, colstar;
  10. for(row=1;row<=noofrows;row++)
  11. {
  12. for(colspaces=noofrows-row;colspaces>=1;colspaces--)
  13. {
  14. printf(" ");
  15. }
  16.  
  17. for(colstar=1;colstar<=row;colstar=colstar++);
  18. printf("* ");
  19.  
  20. }
  21. return 0;
  22. }
  23.  
Time limit exceeded #stdin #stdout 5s 10320KB
stdin
5
stdout
Standard output is empty