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
Why does not c have an exponentiation operator?
Is int a keyword in c?
which of the following shows the correct hierarchy of arithmetic operations in C a) (), **, * or/,+ or - b) (),**,*,/,+,- c) (),**,/,*,+,- d) (),/ or *,- or +
What does %d do?
Explain how can you restore a redirected standard stream?
What is the difference between null pointer and wild pointer?
The file stdio.h, what does it contain?
What are the 4 data types?
What is build process in c?
What is #include conio h?
What are the different categories of functions in c?
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
How can variables be characterized?
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
What is sizeof array?