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