write a program to produce the following output;
ABCDEFGFEDCBA
ABCDEF FEDCBA
ABCDE EDCBA
ABCD DCBA
ABC CBA
AB BA
A A
Answer Posted / atul wagare
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,l,m;
for(i=0;i<7;i++)
{
for(j=0;j<7-i;j++)
{
printf("%c",j+65);
}
for(k=1;k<=i*2-1;k++)
{
printf(" ");
}
if(i==0||i==1)
{
for(l=70;l>=65;l--)
{
printf("%c",l);
}
}
else
{
for(l=70-(i-1);l>=65;l--)
{
printf("%c",l);
}
}
//printf("%d %d",j,k);
printf("
");
}
getche();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9
How are Structure passing and returning implemented by the complier?
What is a program flowchart and explain how does it help in writing a program?
Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?
What is %s and %d in c?
Write a program to generate the Fibinocci Series
What is the difference between far and near ?
What are the disadvantages of c language?
What is difference between Structure and Unions?
What are the complete rules for header file searching?
Subtract Two Number Without Using Subtraction Operator
Write program to remove duplicate in an array?
Which is better between malloc and calloc?
What is string function in c?
How do we print only part of a string in c?