fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int n;
  5. printf("Enter the number of rows: \n");
  6. scanf("%d",&n);
  7. for(int i=1;i<=n;i++){
  8. for(int j=1;j<=n-i;j++){
  9. printf(" ");
  10. }
  11. for(int k=1;k<=n;k++){
  12. printf("*");
  13. }
  14. printf("\n");
  15. }
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0.01s 5280KB
stdin
5
stdout
Enter the number of rows: 
    *****
   *****
  *****
 *****
*****