Showing posts with label character pattern pyramid C program. Show all posts
Showing posts with label character pattern pyramid C program. Show all posts

2.01.2014

Character Pyramid

Q. Write a C program to takes the last character by user and print the following character pyramid as:
(if user input : j), then output would be like as:

A
ABA
ABCBA
ABCDCBA
ABCDEDCBA
ABCDEFEDCBA
ABCDEFGFEDCBA
ABCDEFGHGFEDCBA
ABCDEFGHJHGFEDCBA
ABCDEFGHGFEDCBA
ABCDEFGFEDCBA
ABCDEFEDCBA
ABCDEDCBA
ABCDCBA
ABCBA
ABA
A

Ans.

/*c program for character pyramid*/
#include<stdio.h>
int main()
{