Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

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


Please Help Members By Posting Answers For Below Questions

What are the different types of control structures in programming?

231


How can my program discover the complete pathname to the executable from which it was invoked?

208


Why do we use int main?

190


Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.

222


Where register variables are stored in c?

149






write a c program for swapping two strings using pointer

1677


Tell me what is null pointer in c?

222


How do I copy files?

209


What is getch?

179


Explain what are binary trees?

223


What is a dynamic array in c?

162


How will you write a code for accessing the length of an array without assigning it to another variable?

227


Explain how do you print only part of a string?

236


how to introdu5ce my self in serco

1112


What is meant by realloc()?

219