write a program to produce the following output;
ABCDEFGFEDCBA
ABCDEF FEDCBA
ABCDE EDCBA
ABCD DCBA
ABC CBA
AB BA
A A
Answer Posted / vipandeep
#include<stdio.h>
main()
{
int i,j,k,x,n=-2;
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+4;
printf("\n");
}
getch();
}
| Is This Answer Correct ? | 20 Yes | 4 No |
Post New Answer View All Answers
What is #define in c?
What is dangling pointer in c?
What is const keyword in c?
Do array subscripts always start with zero?
What is external variable in c?
Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)
What are the two types of structure?
Explain the advantages of using macro in c language?
can anyone suggest some site name..where i can get some good data structure puzzles???
How can you find the day of the week given the date?
What are the advantages of union?
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
What is the general form of #line preprocessor?
Why c is a mother language?
#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??