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

Answer Posted / balaji ganesh

main()
{
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 ?    72 Yes 45 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the 5 elements of structure?

570


Can true be a variable name in c?

561


What is data types?

643


why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above

647


‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.

1881






a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler

616


Write a program to print “hello world” without using semicolon?

677


Explain what is the general form of a c program?

626


What are header files in c?

620


What is the purpose of the statement: strcat (S2, S1)?

642


How can a program be made to print the name of a source file where an error occurs?

733


When should I declare a function?

625


Write a program to identify if a given binary tree is balanced or not.

689


Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.

2654


Why is #define used?

792