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
What is the maximum length of an identifier?
Explain the ternary tree?
Explain how can a program be made to print the name of a source file where an error occurs?
What is modifier & how many types of modifiers available in c?
What is the most efficient way to count the number of bits which are set in an integer?
What are different storage class specifiers in c?
What is calloc()?
Describe the difference between = and == symbols in c programming?
What are volatile variables in c?
Why is c used in embedded systems?
What is volatile variable how do you declare it?
Explain what math functions are available for integers? For floating point?
How do you write a program which produces its own source code as output?
Why isnt there a numbered, multi-level break statement to break out
hi folks i m approching for h1 b interview on monday 8th of august at montreal and i m having little problem in my approval notice abt my bithdate my employer has made a mistake while applying it is 12th january and istead of that he had done 18 the of january do any body have any solution for that if yes how can i prove my visa officer abt my real birthdate it urgent please let me know guys thaks dipesh patel