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
Mention four important string handling functions in c languages .
What is spark map function?
Are there constructors in c?
What is %s and %d in c?
How do I use strcmp?
Write a program for Overriding.
What are structure members?
Is file a keyword in c?
How can I remove the trailing spaces from a string?
What is the use of typedef in structure in c?
How can I invoke another program or command and trap its output?
What is conio h in c?
How will you declare an array of three function pointers where each function receives two ints and returns a float?
What is extern storage class in c?
You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.