P049.c (516B)
1 /* Make this pattern for input n no of row. 2 Pattern : 3 # 4 @ @ 5 # # # 6 @ @ @ @ 7 # # # # # 8 */ 9 10 #include <stdio.h> 11 12 int main() 13 { 14 int i, j, n; 15 char a = '#', b = '@'; 16 printf("Enter row number : "); 17 scanf("%d", &n); 18 for (i = 1; i <= n; i++) 19 { 20 for (j = 1; j <= i; j++) 21 { 22 if (i % 2 == 0) 23 printf("%c\t", b); 24 else 25 printf("%c\t", a); 26 } 27 printf("\n"); 28 } 29 return 0; 30 }