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 scope rule in c?
Explain pointers in c programming?
a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler
Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?
What is the heap in c?
What is pointer & why it is used?
What would be an example of a structure analogous to structure c?
I need a sort of an approximate strcmp routine?
What are the various types of control structures in programming?
I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.
What is the data segment that is followed by c?
What are header files and explain what are its uses in c programming?
How can a number be converted to a string?
What is void c?
any "C" function by default returns an a) int value b) float value c) char value d) a & b