write a program to produce the following output;
ABCDEFGFEDCBA
ABCDEF FEDCBA
ABCDE EDCBA
ABCD DCBA
ABC CBA
AB BA
A A
Answer Posted / atul wagare
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,l,m;
for(i=0;i<7;i++)
{
for(j=0;j<7-i;j++)
{
printf("%c",j+65);
}
for(k=1;k<=i*2-1;k++)
{
printf(" ");
}
if(i==0||i==1)
{
for(l=70;l>=65;l--)
{
printf("%c",l);
}
}
else
{
for(l=70-(i-1);l>=65;l--)
{
printf("%c",l);
}
}
//printf("%d %d",j,k);
printf("
");
}
getche();
}
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
When would you use a pointer to a function?
Is stack a keyword in c?
An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?
Differentiate between the expression “++a” and “a++”?
How do I copy files?
What is variable initialization and why is it important?
What is the data segment that is followed by c?
Can we access array using pointer in c language?
Explain how can I convert a string to a number?
1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. The Logic should be written in Data Structures?
Is there a way to switch on strings?
Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
Explain 'bus error'?
What is the use of void pointer and null pointer in c language?
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }