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 we use any name in place of argv and argc as command line arguments?
What are multibyte characters?
What is meant by recursion?
What is the purpose of type declarations?
What are the characteristics of arrays in c?
What are variables c?
Is fortran still used today?
What is || operator and how does it function in a program?
Explain how do you determine the length of a string value that was stored in a variable?
Are the variables argc and argv are local to main?
Explain what is a pragma?
What language is lisp written in?
What is the difference between printf and scanf )?
What is a pointer in c?
Difference between malloc() and calloc() function?