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's the difference between constant char *p and char * constant p?

660


Explain the difference between the local variable and global variable in c?

606


What is advantage of pointer in c?

697


What are 3 types of structures?

596


What is 2c dna?

611






What is the difference between array and pointer in c?

582


Function calling procedures? and their differences? Why should one go for Call by Reference?

639


What is the right type to use for boolean values in c?

589


What is the difference between local variable and global variable in c?

693


what do you mean by inline function in C?

620


How many types of operator or there in c?

607


Is null always defined as 0(zero)?

617


where are auto variables stored? What are the characteristics of an auto variable?

597


Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.

630


Explain which function in c can be used to append a string to another string?

592