write a program to produce the following output;
ABCDEFGFEDCBA
ABCDEF FEDCBA
ABCDE EDCBA
ABCD DCBA
ABC CBA
AB BA
A A
Answer Posted / vinay
main()
{
int i,n=65,m=72,f=0,s=-6;
while(m-->=n)
{s+=4;
for(i=n;i<m;i++)
printf("%c ",i);
if(f==0) ++m;
else
for(i=0;i<s;i++) printf(" ");
for(i=m-1;i>=n;i--)
printf("%c ",i);
printf("\n");f=1;
}
system("pause");
}
| Is This Answer Correct ? | 7 Yes | 6 No |
Post New Answer View All Answers
What is #include stdlib h?
What are the 4 types of programming language?
Is c compiled or interpreted?
Which are low level languages?
What is storage class?
What is define directive?
What are examples of structures?
What is cohesion in c?
Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.
Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?
What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?
Explain how many levels deep can include files be nested?
What is the use of printf() and scanf() functions?
What is #define size in c?
What is NULL pointer?