write a program to produce the following output;
ABCDEFGFEDCBA
ABCDEF FEDCBA
ABCDE EDCBA
ABCD DCBA
ABC CBA
AB BA
A A

Answer Posted / siddharth shravan jha

//Most Easy Way to Solve this type of questions.
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,r,m;

for(i=0;i<7;i++)
{
r=71-i;
for (j=65;j<=r;j++) //ASCII values for A-Z is in range 65-91,i.e.,for A-G is from 65-71
{
printf("%c ",j);
}
for (m=1;m<=i;m++)
{
printf(" ");
}
for (k=r;k>=65;k--)
{
printf(" %c",k);
}
printf("
");
}

}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the function of this pointer?

668


#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }

774


Explain b+ tree?

618


What is the difference between struct and union in C?

568


Can a local variable be volatile in c?

574






Why do we use header files in c?

573


What are c identifiers?

625


What is array of structure in c programming?

748


What is static memory allocation?

602


How can you restore a redirected standard stream?

608


a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none

717


When should you not use a type cast?

657


What is LINKED LIST? How can you access the last element in a linked list?

629


Why c is a mother language?

552


given post order,in order construct the corresponding binary tree

2321