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


Please Help Members By Posting Answers For Below Questions

How do we open a binary file in Read/Write mode in C?

683


What are actual arguments?

649


What is extern c used for?

571


What does %c do in c?

589


a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion

2336






What does calloc stand for?

653


How does placing some code lines between the comment symbol help in debugging the code?

550


What is the main difference between calloc () and malloc ()?

576


What is void main () in c?

738


What is the purpose of the preprocessor directive error?

684


Explain what are compound statements?

608


Can two or more operators such as and be combined in a single line of program code?

813


Explain about the constants which help in debugging?

858


With the help of using classes, write a program to add two numbers.

622


How can you draw circles in C?

628