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
What is the right way to use errno?
Difference between MAC vs. IP Addressing
What is scope rule of function in c?
What does & mean in scanf?
Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.
Does c have an equivalent to pascals with statement?
Can main () be called recursively?
What is the use of sizeof?
How many types of sorting are there in c?
What is function prototype in c language?
What are pointers? What are different types of pointers?
Can we replace the struct function in tree syntax with a union?
what is the structure pointer?
Who is the founder of c language?
write a c programming using command line argument,demonstrate set operation(eg;union,intersection,difference) example output is c:>setop 12 34 45 1 union 34 42 66 c:>setop 12 34 1 42 66 c:>setop 12 34 diff 12 56 67 78 setop 12 34