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


Please Help Members By Posting Answers For Below Questions

What is strcpy() function?

662


How would you rename a function in C?

625


When is a void pointer used?

682


List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.

2309


Should I learn c before c++?

629






What is the sizeof () operator?

626


What is this pointer in c plus plus?

600


using for loop sum 2 number of any 4 digit number in c language

1738


What kind of structure is a house?

562


What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.

1788


writ a program to compare using strcmp VIVA and viva with its output.

1530


What is pointer & why it is used?

609


What is boolean in c?

615


What are variables c?

626


Explain what happens if you free a pointer twice?

617