Advertisement
rayslhcf

May's Star Loop

Sep 7th, 2014
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.52 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5.         int rowInput;
  6.         int coln, row;
  7.  
  8.         printf("Enter the number of rows: ");
  9.         scanf("%d", &rowInput);
  10.  
  11.         for(row=0; row<rowInput; row++)     // นับจำนวน Row
  12.         {
  13.                 for(coln=rowInput-row; coln<rowInput; coln++)
  14.                 {
  15.                     printf(" ");
  16.                 }
  17.                 for(coln=row; coln<rowInput; coln++)
  18.                 {
  19.                     printf("*");
  20.                 }
  21.                 printf("\n");
  22.         }
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement