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
In C programming, how do you insert quote characters (‘ and “) into the output screen?
What is a shell structure examples?
What is dynamic memory allocation?
What are the 4 types of unions?
What does %c do in c?
What is the difference between new and malloc functions?
What does 4d mean in c?
What are header files why are they important?
How many keywords are there in c?
Why does everyone say not to use gets?
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none
write a program in C that prompts the user for today's date,tomorrow's date and display the results.Use structures for today's date,tomorrow's date and an array to hold the days for each month of the year.
What is the basic structure of c?
What is the use of ?: Operator?
What is difference between union and structure in c?