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
Explain how can type-insensitive macros be created?
What is the use of parallelize in spark?
How can I implement a delay, or time a users response, with sub-second resolution?
Is that possible to store 32768 in an int data type variable?
What is a structure member in c?
What is dynamic memory allocation?
What is a pointer in c plus plus?
can anyone please tell about the nested interrupts?
What does it mean when a pointer is used in an if statement?
How are Structure passing and returning implemented by the complier?
What does int main () mean?
This is a variation of the call_me function in the previous question:call_me (myvar)int *myvar;{ *myvar += 5; }The correct way to call this function from main() will be a) call_me(myvar) b) call_me(*myvar) c) call_me(&myvar) d) expanded memory
What is local and global variable in c?
A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile
Does * p ++ increment p or what it points to?