sahajjain01

19.Display Pattern #03

Aug 16th, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.30 KB | None | 0 0
  1. /* Program to display the following pattern:
  2. ****
  3.  ***
  4.   **
  5.    *
  6. */
  7. #include<stdio.h>
  8. #include<conio.h>
  9.  
  10. void main()
  11. {
  12.     int i, j, k;
  13.  
  14.     clrscr();
  15.  
  16.     for(i = 0; i<4; i++) {
  17.         for(k = 0; k < i; k++)
  18.             printf(" ");
  19.         for(j = 4; j > i; j--)
  20.             printf("*");
  21.         printf("\n");
  22.     }
  23.  
  24.     getch();
  25. }
Advertisement
Add Comment
Please, Sign In to add comment