A C program to print following pattern
ABCDE
ABCD
ABC
AB
AB
A
main()
{
int ,i,j,n;
clrscr();
printf("Enter the number of rows:");
scanf("%d",&n);
for(i=n;i>=1;i--)
{
for(j=1;j<=i;j++)
{
printf("%c",'A'+j-1);
}
printf("\n");
}
getch();
}
No comments:
Post a Comment