Program to print the stars in a sequence in C Plus Plus(C++, CPP) and C with flowchart

Program to print the stars in a sequence in C Plus Plus(C++, CPP) and C with flowchart

Sequence of stars must be in followings order;

Program to print the stars in a sequence in C Plus Plus(C++, CPP) and C with flowchart

In this tutorial, we will learn about the followings;

  1. Flowchart of program to print the stars in a sequence 
  2. Program to print the stars in a sequence in C Plus Plus(C++, CPP)
  3. Program to print the stars in a sequence in C 

Flowchart of the program to print the stars in a sequence 

Coming Soon.

Program to print the stars in a sequence in C Plus Plus(C++, CPP)

#include <stdio.h>

int main()
{
    int i, j, k;
    for(i=1;i<=5;i++)
    {
        for(j=i;j<5;j++)
        {
            printf(" ");
        }
        for(k=1;k<(i*2);k++)
        {
                printf("***");
        }
        printf("\n");
    }

    return 0;
}

Output

Program to print the stars in a sequence in C Plus Plus(C++, CPP) and C with flowchart

Figure: Program to print the stars in a sequence in C Plus Plus(C++, CPP) and C with a flowchart.

Program to print the stars in a sequence in C 

#include <stdio.h>

int main()
{
    int i, j, k;
    for(i=1;i<=5;i++)
    {
        for(j=i;j<5;j++)
        {
            printf(" ");
        }
        for(k=1;k<(i*2);k++)
        {
                printf("***");
        }
        printf("\n");
    }

    return 0;
}

Output

Program to print the stars in a sequence in C Plus Plus(C++, CPP) and C with flowchart

Figure: Program to print the stars in a sequence in C Plus Plus(C++, CPP) and C with the flowchart.