ABCDCBA
ABC CBA
AB BA
A A

Answer Posted / vignesh1988i

good question it is :

#include<stdio.h>
#include<conio.h>
void main()
{
int m;
char n,o;
printf("enter the no. of lines :");
scanf("%d",&m);
o='A';
for(int i=0;i<m;i++)
{
n='A';
for(int j=0;j<(m-i);j++)
printf("%c",n++);
for(j=0;j<i;j++)
printf(" ");
for(j=0;j<(m-(i+1));j++)
{
if(j==0||j==1)
{
n='A'+(m-2);
printf("%c",n);
}
else
printf("%c",--n);
}
printf("\n");
}
getch();
}

thnak u

Is This Answer Correct ?    10 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by c what are the main characteristics of c language?

558


What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25

1478


I need testPalindrome and removeSpace #include #define SIZE 256 /* function prototype */ /* test if the chars in the range of [left, right] of array is a palindrome */ int testPalindrome( char array[], int left, int right ); /* remove the space in the src array and copy it over to the "copy" array */ /* set the number of chars in the "copy" array to the location that cnt points t */ void removeSpace(char src[], char copy[], int *cnt); int main( void ) { char c; /* temporarily holds keyboard input */ char string[ SIZE ]; /* original string */ char copy[ SIZE ]; /* copy of string without spaces */ int count = 0; /* length of string */ int copyCount; /* length of copy */ printf( "Enter a sentence:\n" ); /* get sentence to test from user */ while ( ( c = getchar() ) != '\n' && count < SIZE ) { string[ count++ ] = c; } /* end while */ string[ count ] = '\0'; /* terminate string */ /* make a copy of string without spaces */ removeSpace(string, copy, ©Count); /* print whether or not the sentence is a palindrome */ if ( testPalindrome( copy, 0, copyCount - 1 ) ) { printf( "\"%s\" is a palindrome\n", string ); } /* end if */ else { printf( "\"%s\" is not a palindrome\n", string ); } /* end else */ return 0; /* indicate successful termination */ } /* end main */ void removeSpace(char src[], char copy[], int *cnt) { } int testPalindrome( char array[], int left, int right ) { }

2195


How can you find the day of the week given the date?

602


What is an identifier?

612






main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }

623


Write a program which returns the first non repetitive character in the string?

588


What is clrscr in c?

658


What is the heap in c?

627


Why dont c comments nest?

607


Is boolean a datatype in c?

533


What is hashing in c language?

594


Is it acceptable to declare/define a variable in a c header?

673


Dont ansi function prototypes render lint obsolete?

592


What is the full form of getch?

565