0% found this document useful (0 votes)
76 views59 pages

Pyramid

The document contains 80 questions asking to write C programs that generate various numeric and character patterns in the form of triangles, pyramids, rectangles, etc. The patterns include numbers, letters, stars and other symbols arranged in ascending, descending and other orders. Functions and user input are also mentioned. The goal is to practice different types of pattern printing using C programming language.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views59 pages

Pyramid

The document contains 80 questions asking to write C programs that generate various numeric and character patterns in the form of triangles, pyramids, rectangles, etc. The patterns include numbers, letters, stars and other symbols arranged in ascending, descending and other orders. Functions and user input are also mentioned. The goal is to practice different types of pattern printing using C programming language.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 59

Q.

1 Write a program to generate a


following structure:
@@@@@
@@@@@
@@@@@
@@@@@
@@@@@
Q.2 Write a program to generate a
following #'s triangle:
#####
####
## #
##
#
Q.3 Write a program to generate a
following @'s triangle:
@ @ @ @ @
@ @ @ @
@ @ @
@ @
@
Q.4 Write a program to generate a
following #'s triangle:-
#
##
###
####
#####
Q.5 Write a program to generate a
following @'s
triangle:
@
@@
@@ @
@@@@
@@@@@
Q.6 Write a program to generate a
following numbers structure:
12345
12345
12345
12345
12345
Q.7 Write a program to generate a
following numbers structure:
54321
54321
54321
54321
54321
Q.8 Write a program to generate a
following numbers structure:
55555
44444
33333
22222
11111
Q.9 Write a program to generate a
following numbers structure:
11111
22222
33333
44444
55555
Q.10 Write a program to generate a
following numbers structure:
1
12
123
1234
12345
Q.11 Write a program to generate a
following numbers structure:
12345
1234
123
12
1
Q.12 Write a program to generate a
following numbers structure:
1
12
12 3
1234
12345
Q.13 Write a program to generate a
following numbers structure:
54321
4321
321
21
1
Q.14 Write a program to generate a
following numbers structure:
1
21
321
4321
54321
Q.15 Write a program to generate a
following numbers structure:
12345
1234
123
12
1
Q.16 Write a program to generate a
following numbers structure:
12345
1234
12 3
12
1
Q.17 Write a program to generate a
following numbers structure:
1
121
12321
1234321
123454321
Q.18 Write a program to generate a
following numbers structure:
123454321
1234321
12321
121
1

Q.19 Write a C program to print the


following triangle:

*
***
*****
*******
*********
***********
Q.20 Write a C program to print Floyd's
triangle:
1
2 3
4 5 6
7 8 9 10
Q.21 Write a C program to print Pascal
triangle:
1
1 1
1 2 1
1 3 3 1
Q.22 Write a C program to print following
character triangle:
A
B B
C C C
D D D D
Q.23 Write a C program to print following
character triangle:
A
A B A
A B C B A
A B C D C B A
A B C D E D C B A
Q.24 Write a C program to print following
character triangle:
A B C D E D C B A
B C D E D C B
C D E D C
D E D
E
Q.25 Write a c program for following number
structure:
1
22
333
4444
55555
4444
333
22
1

Q.26 Write a C program to display the


string "INDIA" in following fashion:

I
IN
IND
INDI
INDIA
INDIA
INDI
IND
IN
I

Q.27 Write a C program to display the


following character structure:
A
BB
CCC
DDDD
CCC
BB
A

Q.28 Write a C program to display the


following number triangle:
1
22
333
4444
55555

Q. 29 Write a C program display the


following number structure:
123454321
2345432
34543
454
5

Q.30. Write a C program to display the


following number triangle structure:-

1
21
321
4321
54321

Q.31. Write a C program to display the


following number triangle structure:

54321
4321
321
21
1
Q.32 Write a C program to print the
following number pyramid:

1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
6 6 6 6 6 6

Q.33 Write a C program to print the


following number structure:

1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1 2 3 4 5 6

Q. 34 Write a C program to display the


following rhombus symbol structure:
*
***
*****
*******
*****
***
*
Q. 35 Write a C program to display the
following number rhombus structure:
1
212
32123
4321234
32123
212
1
Q. 36 Write a C program to display the
following number rhombus structure:
1
121
12321
1234321
12321
121
1
Q.37 Write a C program to display the
following character rhombus structure:
A
ABA
ABCBA
ABCDCBA
ABCBA
ABA
A
Q.38 Write a C program to display the
following square character triangle:
A
ABA
ABCBA
ABCDCBA
Q.39 Write a C program to display the
following square character triangle:
ABCDCBA
ABCBA
ABA
A

Q.40 Write a C program to display the


following square character triangle:
A
AB
ABC
ABCD
ABCDE
ABCD
ABC
AB
A

Q.41 Write a C program to display the


following square character triangle:

A
BA
CBA
DCBA
EDCBA
DCBA
CBA
BA
A

Q.42 Write a C program to print the


following character triangle:

EDCBA
DCBA
CBA
BA
A

Q.43 Write a C program to print the


following number design/triangle:

9
0 1
2 3 4
5 6 7 8
9 0 1 2 3
Q. 44 Write a C program to print the
following number rectangle:
12344321
123__321
12____21
1______1

Q. 45 Write a C program to print the


following number pyramid or number
structure:

1
1 2 3
1 2 3 4 5
1 2 3 4 5 6 7
1 2 3 4 5 6 7 8 9

Q. 46 Write a C program for print the


following number pyramid:

123456654321
1234554321
12344321
123321
1221
11

Q. 47 Write a C program for print the


following character pyramid:
ABCDEFFEDCBA
ABCDEEDCBA
ABCDDCBA
ABCCBA
ABBA
AA

Q. 48 Write a C program to print the


following number pyramid:

1
222
33333
4444444
555555555

Q. 49 Write a C program to print the


following number triangle:
9
898
78987
6789876

Q. 50 Write a C program to print the


following number triangle:
5
45
345
2345
12345

Q. 51 Write a C program to print the


following number triangle:

5
454
34543
2345432
123454321
Q. 52 Write a C program to print the
following star structure/fashion:

*********
*******
*****
***
*
***
*****
*******
*********

Q. 53 Write a C program to print the


following rectangle number pyramid:

33333
32223
32123
32223
33333

Q. 54 Write a C program to print the star


triangle frame pyramid like as:

*
**
* *
* *
* *
* *
* *
* *
* *
**********

Q. 55 Write a C program to print the


following star pattern pyramid:

*
***
******

Q. 56 Write a C program to display the


reverse star pyramid as:

**********
**** ****
*** ***
** **
* *

Q. 57 Write a C program to display odd


number series pyramid as:

1
3 5 7
9 11 13 15 17 19

Q.58 Write a C program to print the


following number pyramid/triangle:

54321
5432
543
54
5

Q.59 Write a C program to print the number


character pyramid as:

1
AB
123
ABCD
12345

Q. 60 Write a C program to print the


following Floyd triangle as:

1
2 3
4 5 6
7 8 9 10

Q.61 Write a C program to print the


following number pyramid:

1 2 3 4 5
2 3 4 5
3 4 5
4 5
5

Q.62 Write a C program to print the


following character pyramid:

A
BA
ABA
BABA
ABABA

Q.63 Write a C program to accept the number


of rows of pyramid and print the star
pyramid as:if entered number by user is 7
then output would be:

*
**
***
****
***
**
*

Q.64 Write a C program to print the


following number pyramid:

1
232
34543
4567654

Q.65 Write a C program to print the


following number rectangle structure:

12321
12 21
1 1
12 21
12321

Q.66 Write a C program to print the


following character rectangle design:

ABCBA
AB BA
A A
AB BA
ABCBA

Q.67 Write a C program to print the


following star triangle structure:

*********
*******
*****
***
*

Q.68 Write a C program to print the


following number rectangle program:

1234
2341
3412
4123

Q.69 Write a C program to print the


following character rectangle program:

ABCD
BCDA
CDAB
DABC

Q.70 Write a C program to print the


following number pyramid program:

1234
341
12
3
Q.71 Write a C program to print the
following character pyramid program:

ABCD
CDA
AB
C

Q.72 Write a C program to print the


following number pyramid using function:

1
2 3
4 5 6
7 8 9 1
2 3 4 5 6

Q.73 Write a C program to print the


following number pyramid:

1
123
12345
1234567

Q.74 Write a C program to print the


following number pyramid:

1333
2222
3331

Q.75 Write a C program to print number


character pyramid as:

1 a
21 ba
321 cba
4321 dcba
54321 edcba

Q.76 Write a C program to print 0 and 1


number triangle as:

1
01
010
1010
10101

Q.77 Write the 1 and 0 number pyramid


program as:

1
01
101
0101
10101

Q.78 Print Square star pyramid as:


*****
* *
* *
*****

Q.79 Print Rectangle star pyramid as:

******
* *
* *
******

Q.80 Even-odd number star pyramid as:

1
*2
1*3
*2*4
1*3*5

Q.81 Print continue character number


pyramid as:

1
A B
2 3 4
C D E F
5 6 7 8 9

Email ThisBlogThis!Share to TwitterShare to Facebook

98 comments:
1.

vk31 October 2011 10:06

Hello sir, can u give me source code of the following program(i tried to write it,bt can't
do completed,,some error comming:

----1
---212
--32123
---212
----1

(single space=-)
write answer as soon as possible,,Thanks.

ReplyDelete

2.

DineshBera1 November 2011 19:09

@vk,I write your problem solution below, find out your error and enjoy programming
with C.

#include"stdio.h"
#include"conio.h"
void main()
{
int num=3,r=1,c,z,sp;
clrscr();
while(num>=r)
{
sp=num-r;
while(sp>=1)
{
printf(" ");
sp--;
}
c=r;
while(c>=1)
{
printf("%d",c);
c--;
}
z=2;
while(z<=r)
{
printf("%d",z);
z++;
}
printf("\n");
r++;
}
r=1;
while(num>=r)
{
sp=r;
while(sp>=1)
{
printf(" ");
sp--;
}
c=num-r;
while(c>=1)
{
printf("%d",c);
c--;
}
z=2;
while(z<=num-r)
{
printf("%d",z);
z++;
}
printf("\n");
r++;
}
getch();
}

Output:-
___1
__212
_32123
__212
___1

ReplyDelete

3.
gautam16 January 2012 16:22

Hello sir, can u give me source code of the following program


1
22
333
22
1
write answer as soon as possible.
Thanks.

ReplyDelete

Replies

1.

DineshBera21 January 2012 12:33

@Gautam, source code for your problem below. I also write it in above page for
easily readable.

/*c program for above triangle structure*/


#include
#include
int main()
{
int num=3,n,r=1,c;
while(num >= r)
{
c=1;
while(c <= r)
{
printf("%d",r);
c++;
}
printf("\n");
r++;
}
n=num-1;
while(n >= 1)
{
c=1;
while(c <= n)
{
printf("%d",n);
c++;
}
printf("\n");
n--;
}
return 0;
}

Delete

Reply

4.

Moniruzzaman titu27 June 2012 10:14

Code needed for useing modulus


9
01
234
5678
90123

ReplyDelete

Replies

1.

DineshBera27 June 2012 18:54

@Moniruzzaman titu, Your required source code:

http://cprogrammingcodes.blogspot.in/2012/06/pyramid-triangle.html

(I also mention this program to above pyramid page at Q.43)

Delete

Reply

5.

Vedanshu Dash7 July 2012 22:20


how to print
1234321
123_321
12___21
1_____1

ReplyDelete

Replies

1.

DineshBera15 July 2012 17:27

@vedanush Dash, C source code for your number program at:

http://cprogrammingcodes.blogspot.in/2012/07/number-rectangle-structure.html

Delete

Reply

6.

java4u17 July 2012 16:37

Hello sir, can u give me source code of the following program

To accept a string and display its only string stored in even position characters in c
language.

regards,
rajeev
[email protected]

ReplyDelete

Replies

1.

DineshBera18 July 2012 19:52


@Rajeev(java4U), your required source code of above program at:

http://cprogrammingcodes.blogspot.in/2012/07/print-even-position-character.html

Delete

Reply

7.

py440818 July 2012 21:56

plz give progam of


A
BA
ABA
BABA
ABABA

ReplyDelete

Replies

1.

Dinesh Bera18 November 2012 23:36

@py4408,
Your required source code at:
(I also add this program Q.62 )

http://www.cprogrammingcodes.blogspot.in/2012/11/character-pyramid_18.html

Delete

Reply

8.

raghav12 August 2012 01:22

plz give me c++ program for this-

A
aa
BBB
bbbb
CCCCC
cccc
DDD
dd
E

ReplyDelete

9.

Anonymous17 September 2012 12:11

pls give me source for this :

9
898
78987
6789876

ReplyDelete

Replies

1.

DineshBera17 September 2012 23:09

Your required source code for above program at:

http://www.cprogrammingcodes.blogspot.in/2012/09/number-triangle.html

(I also mention this program to above pyramid page at Q.49)

Delete

Reply

10.

Gurpreet Singh23 September 2012 11:51


plz give me c program
___*___
__*_*__
___*___
__*_*__
_*_*_*_
___*___
__*_*__
_*_*_*_
*_*_*_*
___|___
___|___
_-----_

ReplyDelete

Replies

1.

DineshBera25 September 2012 12:18

@Gurpreet Singh,

Source code for your above program at:

http://www.cprogrammingcodes.blogspot.in/2012/09/star-triple-pyramid.html

Delete

Reply

11.

Anonymous4 October 2012 21:16

how to make this, thank you before

33333
32223
32123
32223
33333

ReplyDelete
Replies

1.

DineshBera7 October 2012 00:43

Your required program source code at:


(I also add this program at Q.53)

http://www.cprogrammingcodes.blogspot.in/2012/10/rectangle-number-
pyramid.html

Delete

Reply

12.

Anonymous22 October 2012 11:52

how to create C PROGRAM. Please Help


1
357
9 11 13 15 17

i.e. ODD SERIES in pyramid form.

ReplyDelete

Replies

1.

Dinesh Bera22 October 2012 14:33

Your required odd number series pyramid source code at:


(I also add this program at Q.57)

http://www.cprogrammingcodes.blogspot.in/2012/10/odd-number-series-
pyramid.html

Delete

Reply
13.

Ritesh Roy29 October 2012 21:04

how to create please tell me ..

54321
5432
543
54
5

ReplyDelete

Replies

1.

Dinesh Bera29 October 2012 22:30

@Ritesh Roy,
Your required above number pyramid program source code at:
(I also add this program at Q.58)

http://cprogrammingcodes.blogspot.in/2012/10/number-pyramid.html

Delete

2.

sreenivasulu anthati20 April 2013 21:50

main()
{
int n,i,j,c=1;
clrscr();
printf("Enter the number of rows u want\n");
scanf("%d",n);
for(i=n;i>=1;i--)
{
for(j=n; j>=c;j--)
{
printf("%d",j);
printf(" ");
}
c=c+1;
}
return 0;
getch();
}
please try this code i think it is work is there any problem
please reply me to this mail

Delete

Reply

14.

Smeet Maniar2 November 2012 08:08

Sir,
Can you tell me how to create ?
1
AB
123
ABCD
12345

ReplyDelete

Replies

1.

Dinesh Bera2 November 2012 14:10

@Smeet Maniar,
Your required character-number pyramid source code at:
(I also add this program Q.59)

http://cprogrammingcodes.blogspot.in/2012/11/number-character-pyramid.html

Delete

Reply

15.
Smeet Maniar2 November 2012 08:09

Consider it as a pyramid !

ReplyDelete

16.

Mohitthefuturemessi4 November 2012 16:44

Sir i need a source code for this ..

1-2-3
-2-3
--3

here - accounts for a space .. pl help!

ReplyDelete

Replies

1.

Dinesh Bera4 November 2012 17:23

@Mohitthefuturemessi,

Your required pyramid code source code at:


(i add this program Q.61)

http://www.cprogrammingcodes.blogspot.in/2012/11/number-pyramid.html

Delete

Reply

17.

Mohitthefuturemessi4 November 2012 18:16

please give me the source code of ....

1--2--3
-1---2
---1

ReplyDelete

Replies

1.

Dinesh Bera4 November 2012 18:43

@Mohitthefuturemessi,

Your required number pyramid source code at:

http://cprogrammingcodes.blogspot.in/2012/11/number-pyramid_4.html

Delete

Reply

18.

semere mehari15 November 2012 03:09

how to make program if the user enter the number 3 print the form
*
**
*
and if the user enter the number 5 print the form
*
**
***
**
*
and if the user enter the number 7 print the form
*
**
***
****
***
**
*

ReplyDelete
Replies

1.

Dinesh Bera19 November 2012 00:32

@semere mehari,
Your required program source code at:
(I also add this program Q.63 )

http://cprogrammingcodes.blogspot.in/2012/11/star-pyramid.html

Delete

Reply

19.

Simarpreet Singh15 November 2012 18:22

please give me the source code of ....

ABCBA
AB BA
AA
AB BA
ABCBA

ReplyDelete

Replies

1.

Dinesh Bera2 December 2012 20:16

@Simarpreet Singh,
Your required program source code at:
(I also add this at Q.66)

http://cprogrammingcodes.blogspot.in/2012/12/character-rectangle-design.html

Delete
Reply

20.

Haziq Akhyar19 November 2012 07:28

This comment has been removed by the author.

ReplyDelete

21.

karthi keyan27 November 2012 19:08

i need this output..


1
232
34543
4567654

ReplyDelete

Replies

1.

Dinesh Bera2 December 2012 20:18

@karthi keyan,
Your required program source code at:
(I also add this at Q.64)

http://www.cprogrammingcodes.blogspot.in/2012/12/number-triangle-
program.html

Delete

Reply

22.

Lochan sao29 November 2012 17:49


*********
*******
*****
***
*
plz give me coding for this digram

ReplyDelete

Replies

1.

Dinesh Bera2 December 2012 20:20

@Lochan sao,
Your required source code at:
(I also add this program at Q.67)

http://www.cprogrammingcodes.blogspot.in/2012/12/star-triangle-pyramid.html

Delete

Reply

23.

Dashami Umesh3 December 2012 11:51

ABCD
CDA
AB
C

ReplyDelete

Replies

1.

Dinesh Bera3 December 2012 20:26

@Dashami Umesh,
Your required source code at:
(I also add this program at Q.71)

http://www.cprogrammingcodes.blogspot.in/2012/12/character-pyramid-
program.html

Delete

Reply

24.

Dashami Umesh3 December 2012 11:51

please reply to this

ReplyDelete

25.

jackson hutagaol4 December 2012 00:21

This comment has been removed by the author.

ReplyDelete

26.

alj8 December 2012 23:01

using function

1
23
456
7891
23456

if there were five rows...

ReplyDelete

Replies
1.

Dinesh Bera9 December 2012 15:39

@Alj,
Your required source code of pyramid using function at:
(I also add this program at Q.72)

http://cprogrammingcodes.blogspot.in/2012/12/number-pryamid-by-function.html

Delete

Reply

27.

mani gandan17 December 2012 19:51

i want this c code


1
123
12345
1234567

ReplyDelete

Replies

1.

Dinesh Bera17 December 2012 23:41

@mani gandan,
Your required source code of number pyramid at:
(I also add this program at Q.73)

http://cprogrammingcodes.blogspot.in/2012/12/number-pyramid_17.html

Delete

Reply

28.
sree hari26 December 2012 18:01

program to dsplay the following pattern


1333
2222
3331

ReplyDelete

Replies

1.

Dinesh Bera29 December 2012 01:07

@Sree Hari,
Your required source code of number pyramid at:
(I also add this program at Q.74)

http://cprogrammingcodes.blogspot.in/2012/12/number-rectangle.html

Delete

Reply

29.

kate3 January 2013 00:38

This comment has been removed by the author.

ReplyDelete

30.

kate3 January 2013 00:41

can u give me the code for following pattern

1______a
21_____ba
321____cba
4321___dcba
54321__edcba
ReplyDelete

Replies

1.

Dinesh Bera3 January 2013 15:10

@Kate,
Your required source code of number-character pyramid at:
(I also add this program at Q.75)

http://cprogrammingcodes.blogspot.in/2013/01/number-character-triangle.html

Delete

Reply

31.

sivaji17 January 2013 09:57

can u give me code for printing anybody's name in stars??


ex: siva
****** * * * ***
*****
****** * * * * *
******
****** * ** ** *

ReplyDelete

Replies

1.

Dinesh Bera17 January 2013 14:29

sivaji,
I little bit confuse,
How much stars you want to print? is number_of_stars is equal to
number_of_charater_in_name?
Explained your question.
Delete

Reply

32.

madhura naik26 January 2013 18:41

I want the input for this output:


1
01
101
0101
10101

ReplyDelete

Replies

1.

Dinesh Bera26 January 2013 19:46

@madhura naik,
Your required source code of number-character pyramid at:
(I also add this program at Q.77)

http://www.cprogrammingcodes.blogspot.in/2013/01/1-and-0-pyramid.html

Delete

Reply

33.

Krunal Patel29 January 2013 19:35

I want the input for this output


1
13
135
1357

ReplyDelete
Replies

1.

Muralirao Nagaram30 March 2013 15:45

void main(){
int i,j,n;
clrscr();
printf("enter the row size:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)

printf("%3d",j+j-1);

printf("\n");
}
getch();
}

Delete

Reply

34.

PATIL VAMSI KRISHNA REDDY26 February 2013 01:00

Program for
0
101
21021
3210123

ReplyDelete

Replies

1.

Dinesh Bera21 April 2013 21:31


@PATIL VAMSI KRISHNA REDDY,

Your required program source code at:

http://cprogrammingcodes.blogspot.in/2013/04/odd-number-triangle_21.html

Delete

Reply

35.

Jash Kothari4 March 2013 16:57

program for
1
21A
321AB
4321ABC
54321ABCD

ReplyDelete

Replies

1.

Dinesh Bera22 April 2013 00:13

@Jash Kothari,

Your required program source code at:

http://cprogrammingcodes.blogspot.in/2013/04/number-character-triangle.html

Delete

Reply

36.

Rehm jhy7 March 2013 16:58

Program for Q.19, the star/asterisk triangle using FUNCTION. Thanks. :)


ReplyDelete

37.

Vasim Makda9 March 2013 13:26

DCBA
DCB
DC
B

ReplyDelete

Replies

1.

Muralirao Nagaram29 March 2013 01:00

void main(){
int i,j,p;
clrscr();
for(i=1;i<=4;i++)
{
p=68;
for(j=4;j>=i;j--)
{
printf("%2c",p);
p--;
}
printf("\n");
}
getch();
}

Delete

Reply

38.

Aditya Zunjarrao9 March 2013 17:21


cout<<"\n I WANT YOUR HELP TO FIND THE THE PYRAMID OF";
cin>> A
AB
ABC

ReplyDelete

Replies

1.

Muralirao Nagaram30 March 2013 15:46

void main(){
int i,j,p;
clrscr();
for(i=1;i<=3;i++)
{ p=65;
for(j=1;j<=i;j++)
{
printf("%2c",p);
p++;
}
printf("\n");
}
getch();
}

Delete

Reply

39.

kalochita23 March 2013 08:11

1
121 1 121
12321 121 1 121 12321

program to make this pyramid

ReplyDelete
40.

Shivinder Chandok25 March 2013 21:34

Pls Help

1
11
2222
333333
44444444
5555555555

Thnx in advance

ReplyDelete

Replies

1.

Dinesh Bera26 March 2013 00:42

@Shivinder Chandok,

Your required program source code at:

http://cprogrammingcodes.blogspot.in/2013/03/double-number-triangle.html

Delete

2.

Muralirao Nagaram30 March 2013 15:43

void main()
{
int i,j,n;
clrscr();
printf("enter row size:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{ if(i<3)
printf("%3d",1);
else
for(j=1;j<i;j++)
printf("%3d%3d",i-1,i-1);
}

printf("\n");
}
getch();
}

Delete

Reply

41.

Hima Bindu Manae26 March 2013 22:14

sir can u pls giv d code for...


88888888
87777777
87666666
87655555
87654444
87654333
87654322
87654321

ReplyDelete

Replies

1.

Muralirao Nagaram30 March 2013 15:44

void main(){
int i,j,n;
clrscr();
printf("enter the row size:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=n;j++)
{ //if(j==5)
//printf(" ");

if(j<=i)
printf("%2d",9-j);
else
printf("%2d",8-(i-1));
}
printf("\n");
}
getch();
}

Delete

Reply

42.

Ujaan Nandy28 March 2013 12:30

Sir,I Want the Output of this

- -1
-2 3 2
34543
Thanx in Adance

ReplyDelete

Replies

1.

Dinesh Bera29 March 2013 00:04

@Ujaan Nandy,

Your required program source code at:

http://cprogrammingcodes.blogspot.in/2013/03/static-number-pyramid.html
Delete

Reply

43.

muddu rao29 March 2013 00:33

source code in c send


ABCDEFGFEDCBA
ABCDEF FEDCBA
ABCDE EDCBA
ABCD DCBA
ABC CBA
AB BA
AA
AB BA
ABC CBA
ABCD DCBA
ABCDE EDCBA
ABCDEF FEDCBA
ABCDEFGFEDCBA

ReplyDelete

44.

Anshul Chugh30 March 2013 23:34

How can we make a square of stars in c?

ReplyDelete

Replies

1.

Dinesh Bera1 April 2013 16:08

@Anshul Chugh,

Your required source code of number-character pyramid at:


(I also add this program at Q.78)
http://cprogrammingcodes.blogspot.in/2013/04/square-star-pyramid.html

Delete

Reply

45.

Jimish Shah3 April 2013 19:52

Can you please write this program?

*********
*******
*****
***
*

ReplyDelete

Replies

1.

Dinesh Bera18 April 2013 16:14

@Jimish Shah,

Your required program source code at:

http://cprogrammingcodes.blogspot.in/2013/04/simple-star-pyramid.html

Delete

Reply

46.

Ateet Mishra3 April 2013 23:06

1
**
123
***
12345
*****
can u give me the code for following pattern in c lanuage

ReplyDelete

Replies

1.

Dinesh Bera4 April 2013 22:49

@Ateet Mishra,

Your required program source code at:

http://cprogrammingcodes.blogspot.in/2013/04/number-star-pyramid.html

Delete

Reply

47.

Ateet Mishra3 April 2013 23:15

1
*2
1*3
*2*4
1*3*5
*2*4*6
can u give me the code for following pattern in c language only

ReplyDelete

Replies

1.

Dinesh Bera17 April 2013 21:00


@Ateet Mishra,

Your required source code of above program at:


(I also add this program at Q.80)

http://cprogrammingcodes.blogspot.in/2013/04/even-odd-number-star-
pyramid.html

Delete

Reply

48.

Ateet Mishra3 April 2013 23:19

Can you please write this program? in c language


1
1*
1*3
1*3*
1*3*5
1*3*5*

ReplyDelete

Replies

1.

Dinesh Bera17 April 2013 21:01

@Ateet Mishra,

Your required program source code at:

http://cprogrammingcodes.blogspot.in/2013/04/number-star-pyarmid.html

Delete

Reply

49.
UMER NAWAZ7 April 2013 16:13

i want a program for this output

****
***
**
*
**
***
****

ReplyDelete

Replies

1.

Dinesh Bera17 April 2013 21:55

@UMER NAWAZ,

Your required program source code at:

http://cprogrammingcodes.blogspot.in/2013/04/star-pyramid.html

Delete

Reply

50.

Jannat Patel13 April 2013 14:33

for this output write a program....

A
**
ABC
**
A

*
$$
***
$$$$

1
AB
234
CDEF
56789

0
-1 0 -1
-2 -1 0 -1 -2
-3 -2 -1 0 -1 -2 -3

ReplyDelete

Replies

1.

Dinesh Bera21 April 2013 20:56

@Jannat Patel,

Your required program source code, according your sequence as:

http://cprogrammingcodes.blogspot.in/2013/04/character-symbol-pyramid.html

http://cprogrammingcodes.blogspot.in/2013/04/differ-symbol-pyramid.html

http://cprogrammingcodes.blogspot.in/2013/04/continue-character-number-
pyramid.html

http://cprogrammingcodes.blogspot.in/2013/04/odd-number-triangle_21.html

Delete

Reply

51.
Arulanandasamy Viyagulasamy14 April 2013 01:43

10 9 8 7
456
32
1
i want a program for this output

ReplyDelete

Replies

1.

Dinesh Bera17 April 2013 20:02

@Arulanandasamy Viyagulasamy,

Your required program source code at:

http://cprogrammingcodes.blogspot.in/2013/04/reverse-number-pyramid.html

Delete

Reply

52.

bk00716 April 2013 20:14

code for
------------------*
-------------*--------*
---------* -------*------*
---- * -----*----------*------*

ReplyDelete

53.

Muhammad Shoaib21 April 2013 09:09

Sir, I want the following pattern


1
13
135
1357
13579

ReplyDelete

Replies

1.

Dinesh Bera21 April 2013 18:02

@Muhammad Shoaib,

Your required above program source code at:

http://cprogrammingcodes.blogspot.in/2013/04/odd-number-triangle.html

Delete

Reply

54.

Hridoy Ahmed22 April 2013 23:01

Please do it:
1
23
456
7 8 9 10
11 12 13
14 15
16

You might also like