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

Answer Posted / neeraj kumar

#include<stdio.h>
#include<conio.h>
main()
{
int a,x,n=71,o=70,y=1,c;
clrscr();
for(x=1;x<=7;x++)
{
for(a=65;a<=n;a++) // loop for printing ABCDEFG
printf("%c",a);
if(x==2)
o=70;
for(c=2;c<y;c++) //space loop
printf(" ");
for(a=o;a>=65;a­­) // loop for printing FEDCBA
printf("%c",a);
printf("
"); // to sta
n­­;
o­­;
y=y+2;
}g
etch();
} (g
) Write a program to fill the entire screen with diamond and heart alternatively. The ASCII
value for heart is 3 and that of diamond is 4.
#include<stdio.h>
#include<conio.h>
main()
{
int a, b,c,d;
clrscr();
for(c=1;c<=37;c++)
{
for(d=1;d<=49;d++)
{
for(a=4;a<=4;a++)
{
for(b=3;b<=3;b++)
printf("%c%c ",a,b);
}
}
}
getch();

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why does not c have an exponentiation operator?

631


Is int a keyword in c?

559


which of the following shows the correct hierarchy of arithmetic operations in C a) (), **, * or/,+ or - b) (),**,*,/,+,- c) (),**,/,*,+,- d) (),/ or *,- or +

1190


What does %d do?

729


Explain how can you restore a redirected standard stream?

594






What is the difference between null pointer and wild pointer?

642


The file stdio.h, what does it contain?

670


What are the 4 data types?

604


What is build process in c?

647


What is #include conio h?

598


What are the different categories of functions in c?

649


Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 450 students in the college. 1.write a function to print names of all students who joined in a particular year 2.write a function to print the data of a student whose roll number is given

2522


How can variables be characterized?

1654


any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above

636


What is sizeof array?

615