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 Series⭐

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.

Some of the following patterns included in this series:

  • Right Half Pyramid

Pattern:

  *
  * *
  * * *
  * * * *
  * * * * *
  • Triangle Star Pattern

    Pattern:

        *
       ***
      *****
     *******
    *********
  • Inverted Triangle Star Pattern

Pattern:

    *********
     *******
      *****
       ***
        *
  • Diamond Shape

Pattern:

        *
       ***
      *****
     *******
    *********
     *******
      *****
       ***
        *
  • Left Half Pyramid

Pattern:

        *
      * *
    * * * 
  * * * *
* * * * *
  • Square Fill Pattern

Pattern:

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

Example of Half Pyramid

code:

int main()
int n ;
cin>>n;
{
    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

No packages published

Languages