write a program to produce the following output;
ABCDEFGFEDCBA
ABCDEF FEDCBA
ABCDE EDCBA
ABCD DCBA
ABC CBA
AB BA
A A
Answer Posted / deepak shrimali
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,p,q;
clrscr();
q=-1;
for(i=71;i>=65;i--,q++)
{
for(j=65;j<=i;j++)
{
printf("%c",j);
}
if(i!=71)
{
for(p=0;p<2*q+1;p++)
{
printf(" ");
}
}
if(i==71)
{
k=i-1;
}
else
{
k=i;
}
for(;k>=65;k--)
{
printf("%c",k);
}
printf("\n");
}
getch();
}
| Is This Answer Correct ? | 8 Yes | 4 No |
Post New Answer View All Answers
What is union and structure in c?
What does p mean in physics?
What is structure pointer in c?
What do you mean by c what are the main characteristics of c language?
What are the different file extensions involved when programming in C?
Which is best book for data structures in c?
An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?
In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping
Tell us bitwise shift operators?
c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above
Why is python slower than c?
Write a program to swap two numbers without using third variable in c?
What is identifier in c?
What is a pragma?
What is pointer in c?