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
What is the role of this pointer?
What is the difference between memcpy and memmove?
When is a null pointer used?
Explain union.
what are the facialities provided by you after the selection of the student.
Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix
Why doesnt that code work?
What is #pragma statements?
Was 2000 a leap year?
How do you initialize pointer variables?
How important is structure in life?
What is the stack in c?
What is an auto keyword in c?
how to capitalise first letter of each word in a given string?
Explain what is page thrashing?