Patterns and Shapes C++

Today I’ll share almost all the various patterns and shapes c++ made using triangles, pyramid including asterisks, numbers, alphabets etc., let’s start.

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

 

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

PROGRAM:

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

PROGRAM:

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

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.

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.

PROGRAM: 

8- C++ program to display reverse pyramid. 

PROGRAM:

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

PROGRAM:

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

PROGRAM:

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

PROGRAM:

12.  C++ Program to display following pattern:

Program:

Comments

  1. Very simple and easy

  2. how about
    2
    642
    8642
    108642
    ?

  3. 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. 0713168461 says:

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

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

  7. Please help
    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

  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

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

    • #include
      using namespace std;
      int main()
      {
      for(int i=0;ii;j–)
      cout<< " ";
      { for(int k=0;k<=i;k++)
      cout<<"* ";}
      cout<=1;l–)
      { for (int m=0;m<=3-l;m++)
      cout<<" ";
      { for (int n=0;n<=l;n++)
      cout<<"* ";
      }
      cout<<endl;
      }
      //cout<<endl;//
      }

  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. talha younas says:

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

  12. talha younas says:

    sorry its asteric * not asteroid

  13. * * * * * * * * * * * * * * * * * * * * *
    * * * * * * * * *
    * * * * * * * *
    * * * * * * *
    * * * * * *
    * *
    * * * * * * * * * * * * * * * * * * * * *

    Plz send me code….

  14. I want a coding for * *
    * *
    * *
    * *
    * *
    * *
    In cpp
    Plz reply…

  15. Can u plz tell me
    1
    10
    101
    1011
    10111

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

    thank yo u

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

    • 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;
      }

    • FAHIM ASLAM says:

      int main(){
      for(int i=1;i<=8;i++){
      if(i%2==0){
      for(int j=1;j<=i;j++){
      if(i==8){
      i=6;}
      cout<<"*";}
      cout" \n";}
      return 0;}

  18. hi can anyone help me with this by using for loops

    ***1
    **21
    *321
    4321

  19. 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

  20. hi can anyone help me with this by using for loops

    55555
    44444
    33333
    22222
    11111

  21. Hello Dear how to create bellow pyramid
    1
    121
    12321
    1234321
    123454321

  22. please create this pattern for me..

    12345
    23451
    34512
    45123
    51234
    12345

  23. Sourav chakraborty says:

    1 1
    12 3
    123 6
    1234 10
    12345 15

    plzz help me admin

  24. 1
    212
    32123
    what about this

  25. ajay kakadiya says:

    123
    894
    765

    please friend solve this pattern and code return me

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

  27. How can i print
    #*****
    *#****
    **#***
    ***#**
    ****#*
    *****#

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

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

  30. delicate doll says:

    itni tuf lgti aaa mjy programming m kia krn

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

  32. Oops.. It’s like this
    5555555555
    4444 4444
    333 333
    22 22
    1 1

  33. FAHIM ASLAM says:

    All the students plz Keep Calm and Code ON ….

  34. Muhammad Uzair says:

    1
    11
    101
    1001

  35. #
    #
    # # # # #
    #
    #

    need help to print this

  36. Shankar Pal says:

    *****
    * *
    * *
    * *
    *****
    Please help to give the proper coding for this question

  37. BAASARA NIZAM says:

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

    • #include
      using namespace std;
      int main()
      {
      int i,j;
      for(i=1;i<=6;i++){

      for(j=1;j<=i;j++){

      cout<<"*";

      }cout<<endl;

      }
      }

  38. I want a flight symbol…
    Pls help me

  39. yuvraj unde says:

    plz help me for this pattern

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

  40. *****
    ***
    *
    ***
    *****

  41. plzzz code 4this

  42. Power Of Ideas says:

    BAASARA NIZAM this is code for your triangle pattern

    #include
    #include

    void main()
    {
    int i,j;
    clrscr();
    for(i=1; i<=5; i++)
    {
    for(j=1; j<i; j++)
    {
    cout<<"*";
    }
    cout<<"\n";
    }
    getch();
    }

  43. Sir, I’d made a pattern in c++ in very complicated format. Can you please make it short and easy.
    *
    * *
    * * *
    * * * *
    * * * * *
    * *
    * * * *
    * * * * * *
    * * * *
    * *
    * * * * *
    * * * *
    * * *
    * *
    *

  44. *****
    * *
    * *
    *****
    pls help me to draw this.

  45. zafar abbas says:

    how to draw that pattern?
    1
    2 2
    3 3
    4 4

Leave a Reply