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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!