Question: * write algorithm According to the given program* Please Help WRITE A C PROGRAM TO PRINT ALPHABET TRIANGLE. A ABA ABCBA ABCDCBA ABCDEDCBA Program: #include
* write algorithm According to the given program* Please Help
WRITE A C PROGRAM TO PRINT ALPHABET TRIANGLE.
A
ABA
ABCBA
ABCDCBA
ABCDEDCBA
Program:
#include
int main()
{
int i,j,k,m,rows;
printf("Enter the number of rows ");
scanf("%d",&rows);
int ch=65;
for(i=1; i<=rows; i++)
{
for(j=rows; j>=i; j--)
{
printf(" ");
}
for(k=1; k<=i; k++)
{
printf("%c",ch++);
}
ch--;
for(m=1; m
printf("%c",--ch);
}
printf(" ");
}
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
