Advertisement
Yesideez

Simple Pattern 1

Jan 1st, 2019
467
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. #define cls() printf("\033[H\033[J");
  4.  
  5. void main() {
  6.   int row,line,width,dir=1;
  7.   cls();
  8.   for (row=1;row<11;row++) {
  9.     for (line=0;line<=width;line++) {
  10.       printf("@");
  11.     }
  12.     printf("\n");
  13.     width+=dir;
  14.     if (row==4) {dir=-1;}; //change direction
  15.   }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement