PPS Practical 31
- Aim: Write a program to print following patterns :
i AAAAA ii ABCDE BBBB ABCD CCC ABC DD AB E A
- Code:
-
//For turbo C++ remove below comments #include <stdio.h> //#include<conio.h> void main() { int i, j, n; //clrscr(); printf("Enter number of rows : "); scanf("%d", &n); for (i = 65; i < n+65; i++){ for (j = n; j > i-65; j--){ printf("%c",i); } printf("\n"); } // getch(); }
-
//For turbo C++ remove below comments #include <stdio.h> //#include<conio.h> void main() { int i, j, n; //clrscr(); printf("Enter number of rows : "); scanf("%d", &n); for (i = 65+n; i > 65; i--){ for (j = 65; j < i; j++){ printf("%c",j); } printf("\n"); } // getch(); }
-
- Output:
Comments
Post a Comment