write a program to produce the following output;
ABCDEFGFEDCBA
ABCDEF FEDCBA
ABCDE EDCBA
ABCD DCBA
ABC CBA
AB BA
A A
Answer Posted / vipandeep
#include<stdio.h>
main()
{
int i,j,k,x,n=-2;
i=71;
while (i>=65)
{
for(j=65;j<=i;j++)
{
printf("%c ",j);
}
if(i!=71)
{
for(x=1;x<=n;x++)
{
printf(" ");
}
}
for(k=i;k>=65;k--)
{
if (k==71)
continue;
printf("%c ",k);
}
i--;
n=n+4;
printf("\n");
}
getch();
}
| Is This Answer Correct ? | 20 Yes | 4 No |
Post New Answer View All Answers
write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.
What is 2c dna?
What is header file definition?
Explain the red-black trees?
What is static memory allocation? Explain
Write a c program to build a heap method using Pointer to function and pointer to structure ?
What is the difference between typedef and #define?
What are enumerated types?
What is the difference between functions abs() and fabs()?
What the advantages of using Unions?
Can a file other than a .h file be included with #include?
How are strings stored in c?
What is binary tree in c?
Explain the difference between strcpy() and memcpy() function?
Can we change the value of #define in c?