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

Synonymous with pointer array a) character array b) ragged array c) multiple array d) none

620


What is the use of gets and puts?

606


Can you pass an entire structure to functions?

698


exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above

667


What is putchar() function?

640






2) Write a program that will help Air Traffic Control for an airport to view the sequence of flights ready for take-off. The airport can accommodate 10 flights waiting for take-off at any point in time. Each flight has a unique 3 digit numeric identifier.  Each time a flight takes-off, Air Traffic Control adds a flight to the waitlist. Each time a flight is added to the waitlist, the list of flights waiting to take-off must be displayed.  When a flight is cleared for take-off, Air Traffic Control removes the flight from the waitlist. Each time a flight takes-off, the list of flights waiting to take-off must be displayed.  Sequence of take-off is the sequence of addition to the waitlist

2521


int i=3; this declaration tells the C compiler to a) reserve space in memory to hold the integer value b) associate the name i with this memory location c) store the value 3 at this location d) all the above

756


What are qualifiers and modifiers c?

551


Write programs for String Reversal & Palindrome check

601


Is it better to use a macro or a function?

659


provide an example of the Group by clause, when would you use this clause

1711


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

592


What is a MAC Address?

631


What is the purpose of main() function?

662


swap 2 numbers without using third variable?

666