write a program to produce the following output;
ABCDEFGFEDCBA
ABCDEF FEDCBA
ABCDE EDCBA
ABCD DCBA
ABC CBA
AB BA
A A
Answer Posted / sanchita sengupta
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int i,j,k,x,n=-1;
i=71;
while(i>=65)
{
for(j=65;j<=i;j++)
{
printf("%c",j);
}
if(i!=71)
{
for(x=1;x<=n;x++)
{
printf(" ");
}
}
for(k=i;k>=65;k--)
{
if(k==71)
continue;
printf("%c",k);
}
i--;
n=n+2;
printf("\n");
}
getch();
}
| Is This Answer Correct ? | 10 Yes | 4 No |
Post New Answer View All Answers
Can a pointer be volatile in c?
what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?
How can I sort a linked list?
What is wrong with this program statement? void = 10;
What is difference between structure and union with example?
What the different types of arrays in c?
What is operator precedence?
Is c a great language, or what?
Can main () be called recursively?
How can you tell whether a program was compiled using c versus c++?
What is difference between %d and %i in c?
How would you rename a function in C?
Write a simple code fragment that will check if a number is positive or negative.
What is array within structure?
cin.ignore(80, _ _);This statement a) ignores all input b) ignores the first 80 characters in the input c) ignores all input till end-of-line d) iteration