# Patterns and Shapes C++

## Following are the various Patterns and shapes C++ Programming:

```*
* *
* * *
* * * *
* * * * *```

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

```A
B B
C C C
D D D D
E E E E E```

### 4- C++ Program to print inverted half pyramid using * as shown below.

```* * * * *
* * * *
* * *
* *
*```

### 5- C++ Program to print inverted half pyramid as using numbers as shown below.

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

### 6- C++ Program To display the pyramid of * and digits.

```        *
* * *
* * * * *
* * * * * * *
* * * * * * * * *```

### 7- C++ program to print the pyramid of digits in pattern as below.

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

### 8- C++ program to display reverse pyramid.

```* * * * * * * * *
* * * * * * *
* * * * *
* * *
*```

### 9- C++ Program to Draw Pascal’s triangle as below.

```          1
1   1
1   2   1
1   3   3    1
1  4    6   4   1
1  5   10   10  5   1```

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

### 11- C++ Program to draw inverted hollow triangle.

```* * * * * * *
*         *
*     *
* *
*```

## 42 thoughts on “Patterns and Shapes C++”

1. Srimathi says:

Very simple and easy

1. Ahmed rehman says:

can u send me ur email id plz

2. Anupam Goel says:

give me tutions

2. Nizz says:

2
642
8642
108642
?

3. Nizz says:

oh, not that . the 2’s are all align.

4. pandey pawan says:

all example is very simple & easy but some example explain is complicated way

5. congrats for your support in programming,,,,,,,can i get a code to draw the shape of a star using asteriks

can you please explain what type of star?

Admin plz make this.. *****
** *
* * *
*****

Sorry cannot understand your pattern. Please write from next line.

Insert uppercase character:E
E D C B A B C D E
D C B A B C D
C B A B C
B A B
A

1. A is vertical align. Pattern should be like inverted pyramid

Use 8th program above. Just take a variable as
ascii value of ‘A’ and increment or decrement it accordingly

8. 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
1 2 3 4 5 6 7
1 2 3 4 5
1 2 3
1

1. Nouman Ali says:

Using Five LOOPs ………………..

1. anabia says:

plz can anyone tell me about this program that how we display the following pattern using nested for loop in c++:
1 2 3 4 5
1 3 5 7 11
1 4 7 10 13
?

9. dhurga says:

pls help me to draw this pattern
*
* *
* * *
* * * *
* * * * * * * * * *
* * * *
* * *
* *
*

10. Harsh Sharma says:

1 2 3 4 5 6 7 8 9 10
36 37 38 39 40 41 42 43 44 11
35 64 65 66 67 68 69 70 45 12
34 63 84 85 86 87 88 71 46 13
33 62 83 96 97 98 89 72 47 14
32 61 82 95 100 99 90 73 48 15
31 60 81 94 93 92 91 74 49 16
30 59 80 79 78 77 76 75 50 17
29 58 57 56 55 54 53 52 51 18
28 27 26 25 24 23 22 21 20 19

can anyone one help me with this pattern using c++?

11. anyone can tell how to make +,-%,/ theses shapes by using asteroid

12. waqas says:

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

Plz send me code….

1. waqas says:

Draw a Square and write in side MIT

13. I want a coding for * *
* *
* *
* *
* *
* *
In cpp

14. diva says:

Can u plz tell me
1
10
101
1011
10111

15. can you please explain how to draw an E of “*” using odd numbers above 5?

thank yo u

16. anwesha says:

plz help me to make this pattern
* *
* * * *
* * * * * *
* * * * * *

1. Ibad ur Rehman says:

#include
using namespace std;
int main()
{
int i,j;
for(i=1; i<=3; i++)
{
for(j=1; j<=i; j++)
{
cout<<"**";
}
cout<<endl;

}
cout<<"******"<<endl;
system("pause");
return 0;
}

17. bella says:

hi can anyone help me with this by using for loops

***1
**21
*321
4321

18. Martial Himanshu says:

if n=4,output is
1 2 3 4
9 10 11 12
13 14 15 16
5 6 7 8
pls suggest me logic

19. allan says:

hi can anyone help me with this by using for loops

55555
44444
33333
22222
11111

20. Talha says:

please create this pattern for me..

12345
23451
34512
45123
51234
12345

21. Sourav chakraborty says:

1 1
12 3
123 6
1234 10
12345 15

plzz help me admin

22. mahmoud says:

1
212
32123

23. ajay kakadiya says:

123
894
765

please friend solve this pattern and code return me

24. jaishi says:

how to write this program plz help
****5
***4 8
**3 6 9
*2 4 8 12
1 2 3 4 5

25. Iram says:

How can i print
#*****
*#****
**#***
***#**
****#*
*****#

26. jaimin says:

pls. show me how to make this
1 1
12 21
123 321
1234321

27. #include

using namespace std;

int main()
{
for(int i=0; i<6; i++)
{
for(int j=0;j<6; j++)
{
if(i==j)
{
cout<<"#";
}
else
{
cout<<"*";
}
}
cout<<endl;
}
return 0;
}

28. delicate doll says:

itni tuf lgti aaa mjy programming m kia krn

Hey admin… Help me solve this
5555555555
4444 4444
333 333
22 22
1 1