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
Explain 'far' and 'near' pointers in c.
Define VARIABLE?
Can the “if” function be used in comparing strings?
how to execute a program using if else condition and the output should enter number and the number is odd only...
what is recursion in C
What does typedef struct mean?
Under what circumstances does a name clash occur?
I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.
How will you declare an array of three function pointers where each function receives two ints and returns a float?
What are the differences between new and malloc in C?
How can I make it pause before closing the program output window?
What is the use of ?
What is void main ()?
Is c object oriented?
Why is c still so popular?