Skip to content

This repository showcases different star patterns created using C++. Star patterns are a great way to practice nested loops and improve your problem-solving skills in a fun and visually appealing way.

Notifications You must be signed in to change notification settings

ansiace/Star-Pattern

Repository files navigation

Star Pattern Collection⭐

Star Pattern

Welcome to the ⭐ Pattern repository! This repository contains various star patterns implemented in c++ programming languages. These patterns are commonly used in coding practice and interviews to demonstrate understanding of loops and basic programming constructs.

Some of the following patterns included:

  1. Half Pyramid

Pattern:

  *
  * *
  * * *
  * * * *
  * * * * *
  1. Full Pyramid

Pattern:

       *
      ***
     *****
    *******
   *********
  1. Inverted Pyramid

Pattern:

    *********
     *******
      *****
       ***
        *
  1. Diamond Shape

Pattern:

        *
       ***
      *****
     *******
    *********
     *******
      *****
       ***
        *
  1. Right Angle Triangle

Pattern:

 *
 **
 ***
 ****
 *****
  1. Left Angle Triangle

Pattern:

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

Example Half Pyramid

code:

int main()
{
    for(int i=1;i<=5;i++)
    {
        for(int j=1;j<=5;j++)
        {
            if(j<=i)
            {
                cout<<"⭐";
            }
            else
            {
                cout<<" ";
            }
        }
        cout<<endl;
        
    }
    
}

output:

⭐⭐
⭐⭐⭐
⭐⭐⭐⭐
⭐⭐⭐⭐⭐

About

This repository showcases different star patterns created using C++. Star patterns are a great way to practice nested loops and improve your problem-solving skills in a fun and visually appealing way.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages