write a program to produce the following output;
ABCDEFGFEDCBA
ABCDEF FEDCBA
ABCDE EDCBA
ABCD DCBA
ABC CBA
AB BA
A A
Answer Posted / amit kumar
#include<stdio.h>
#include<conio.h>
main()
{
int i,j,k,s;
for(i=71;i>=65;i--) //first half of sequence
{
for(j=65;j<=i;j++)
{
printf("%c",j);
}
for(s=1;s<((72-j)*2);s++) //for spaces between two trinangles
printf(" ");
for(k=i;k>=65;k--) //for second half of sequence
{
if(k==71)
continue;
printf("%c",k);
}
printf("\n");
}
getch();
return 0;
}
| Is This Answer Correct ? | 11 Yes | 1 No |
Post New Answer View All Answers
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
What is LINKED LIST? How can you access the last element in a linked list?
What is difference between array and structure in c?
What are unions in c?
What are the types of macro formats?
What do you mean by keywords in c?
How to write a code for implementing my own printf() and
scanf().... Please hep me in this... I need a guidance...
Can you give an coding for c... Please also explain about
the header files used other than #include
what is the different bitween abap and abap-hr?
What is the sizeof () operator?
Where define directive used?
what is the significance of static storage class specifier?
Can you assign a different address to an array tag?
Differentiate between the = symbol and == symbol?
Why #include is used in c language?
What is the difference between text and binary i/o?