write a program to produce the following output;
ABCDEFGFEDCBA
ABCDEF FEDCBA
ABCDE EDCBA
ABCD DCBA
ABC CBA
AB BA
A A
Answer Posted / balaji ganesh
main()
{
int i,n=65,m=72,f=0,s=-6;
clrscr();
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;
}
getch();
}
| Is This Answer Correct ? | 73 Yes | 45 No |
Post New Answer View All Answers
When should you use a type cast?
What is a void * in c?
In a header file whether functions are declared or defined?
Differentiate between null and void pointers.
What is structure padding and packing in c?
Discuss the function of conditional operator, size of operator and comma operator with examples.
When should you not use a type cast?
When can you use a pointer with a function?
What is #include stdio h?
What is the purpose of & in scanf?
What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?
What is a pointer value and address in c?
How do you use a pointer to a function?
What are the 3 types of structures?
a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion