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
What is the function of this pointer?
#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); }
Explain b+ tree?
What is the difference between struct and union in C?
Can a local variable be volatile in c?
Why do we use header files in c?
What are c identifiers?
What is array of structure in c programming?
What is static memory allocation?
How can you restore a redirected standard stream?
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
When should you not use a type cast?
What is LINKED LIST? How can you access the last element in a linked list?
Why c is a mother language?
given post order,in order construct the corresponding binary tree