write a program to produce the following output;
ABCDEFGFEDCBA
ABCDEF FEDCBA
ABCDE EDCBA
ABCD DCBA
ABC CBA
AB BA
A A
Answer Posted / siddharth shravan jha
//Most Easy Way to Solve this type of questions.
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,r,m;
for(i=0;i<7;i++)
{
r=71-i;
for (j=65;j<=r;j++) //ASCII values for A-Z is in range 65-91,i.e.,for A-G is from 65-71
{
printf("%c ",j);
}
for (m=1;m<=i;m++)
{
printf(" ");
}
for (k=r;k>=65;k--)
{
printf(" %c",k);
}
printf("
");
}
}
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How do we open a binary file in Read/Write mode in C?
What are actual arguments?
What is extern c used for?
What does %c do in c?
a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion
What does calloc stand for?
How does placing some code lines between the comment symbol help in debugging the code?
What is the main difference between calloc () and malloc ()?
What is void main () in c?
What is the purpose of the preprocessor directive error?
Explain what are compound statements?
Can two or more operators such as and be combined in a single line of program code?
Explain about the constants which help in debugging?
With the help of using classes, write a program to add two numbers.
How can you draw circles in C?