write a program to produce the following output;
ABCDEFGFEDCBA
ABCDEF FEDCBA
ABCDE EDCBA
ABCD DCBA
ABC CBA
AB BA
A A
Answer Posted / deepak shrimali
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,p,q;
clrscr();
q=-1;
for(i=71;i>=65;i--,q++)
{
for(j=65;j<=i;j++)
{
printf("%c",j);
}
if(i!=71)
{
for(p=0;p<2*q+1;p++)
{
printf(" ");
}
}
if(i==71)
{
k=i-1;
}
else
{
k=i;
}
for(;k>=65;k--)
{
printf("%c",k);
}
printf("\n");
}
getch();
}
| Is This Answer Correct ? | 8 Yes | 4 No |
Post New Answer View All Answers
What is the general form of a C program?
Tell me is null always defined as 0(zero)?
What is the heap in c?
What is sizeof in c?
what is the difference between 123 and 0123 in c?
Why we not create function inside function.
c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above
Explain output of printf("Hello World"-'A'+'B'); ?
What is clrscr ()?
What is the full form of getch?
my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?
Why flag is used in c?
What is calloc()?
What does emoji p mean?
What are the keywords in c?