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
explain what are pointers?
Simplify the program segment if X = B then C ← true else C ← false
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
Is sizeof a keyword in c?
Why main function is special give two reasons?
How can you return multiple values from a function?
In C programming, what command or code can be used to determine if a number of odd or even?
FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.
Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)
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
How can I find the modification date and time of a file?
What is conio h in c?
What is infinite loop?
When c language was developed?
Explain how can I manipulate strings of multibyte characters?