programming-examples/c/Pattern_Programs/P_A_AB_ABC..c

36 lines
481 B
C
Raw Normal View History

2019-11-15 12:59:38 +01:00
/* Pattern problem
A
A B
A B C
A B C D
A B C D E
*/
#include <stdio.h>
#include <conio.h>
void main()
{
int i, j, n ;
clrscr() ;
printf("Required pattern is as follows: \n") ;
for(i=1 ; i<=5 ; i++)
{
for(j=1 ; j<=i ; j++)
printf("%c ", j+64) ;
printf("\n") ;
}
getch();
}
/*
Output:
Required pattern is as follows:
A
A B
A B C
A B C D
A B C D E
*/