write a program to produce the following output;
ABCDEFGFEDCBA
ABCDEF FEDCBA
ABCDE EDCBA
ABCD DCBA
ABC CBA
AB BA
A A

Answer Posted / karthikeyan ist year cse skc

in()
{
int i,n=65,m=72,f=0,s=-6;
clrscr();
while(m-->=n)
{s+=4;
for(i=n;i<m;i++)
printf("%c ",i);
if(f==0) ++m;
else
for(i=0;i<s;i++) printf(" ");
for(i=m-1;i>=n;i--)
printf("%c ",i);
printf("\n");f=1;
}
getch();
}

Is This Answer Correct ?    5 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to swap two numbers without using third variable in c?

588


What is the use of a ‘’ character?

562


What is the difference between a string and an array?

687


Is c is a middle level language?

569


What are the advantages and disadvantages of pointers?

552






What is pointers in c with example?

548


Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?

540


Explain data types & how many data types supported by c?

558


Can we declare a function inside a function in c?

557


Why C language is a procedural language?

590


How can you tell whether a program was compiled using c versus c++?

601


What is the scope of an external variable in c?

544


What is the explanation for cyclic nature of data types in c?

613


What are c identifiers?

606


write a c program to print the next of a particular no without using the arithmetic operator or looping statements?

3141