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


Please Help Members By Posting Answers For Below Questions

Explain how can type-insensitive macros be created?

577


What is the use of parallelize in spark?

582


How can I implement a delay, or time a users response, with sub-second resolution?

631


Is that possible to store 32768 in an int data type variable?

696


What is a structure member in c?

552






What is dynamic memory allocation?

812


What is a pointer in c plus plus?

700


can anyone please tell about the nested interrupts?

1682


What does it mean when a pointer is used in an if statement?

608


How are Structure passing and returning implemented by the complier?

719


What does int main () mean?

556


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

738


What is local and global variable in c?

623


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

650


Does * p ++ increment p or what it points to?

621