Patterns and Shapes C++

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

 

1- C++ Program To display the half pyramid of *, numbers and character.

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

PROGRAM:


  Alternate Download: halfpyramid.c

2- C++ Program to print half pyramid as using numbers as shown in figure below.

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

PROGRAM:

3- C++ Program to print triangle of characters as below

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

PROGRAM:

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

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

PROGRAM:

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

PROGRAM:

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

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

PROGRAM: 

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

PROGRAM: 

8- C++ program to display reverse pyramid. 

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

PROGRAM:

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

PROGRAM:

10- C++ Program to display Floyd’s Triangle.

1
2 3
4 5 6
7 8 9 10

PROGRAM:

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

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

PROGRAM:

36 thoughts on “Patterns and Shapes C++

      1. 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
        ?

  1. 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++?

  2. * * * * * * * * * * * * * * * * * * * * *
    * * * * * * * * *
    * * * * * * * *
    * * * * * * *
    * * * * * *
    * *
    * * * * * * * * * * * * * * * * * * * * *

    Plz send me code….

    1. #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;
      }

Leave a Reply