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
What is strcpy() function?
How would you rename a function in C?
When is a void pointer used?
List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.
Should I learn c before c++?
What is the sizeof () operator?
What is this pointer in c plus plus?
using for loop sum 2 number of any 4 digit number in c language
What kind of structure is a house?
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
writ a program to compare using strcmp VIVA and viva with its output.
What is pointer & why it is used?
What is boolean in c?
What are variables c?
Explain what happens if you free a pointer twice?