Star Pattern program | pattern 2 : Triangle pattern program in C

Spread the love
Q: Write a C Program to print below pattern.


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

Program: Star Pattern :

  1. #include<stdio.h>
  2. int main()
  3. {
  4.    int i,j,n;
  5.    printf(“Enter How many rows you want: “);
  6.    scanf(“%d”,&n);
  7.    for(i=1;i<=n;i++)
  8.    {
  9.       for(j=1;j<=i;j++)
  10.       {
  11.          printf(“* “);
  12.       }
  13.       printf(n);
  14.    }
  15.    return 0;
  16. }

Output :

Output of star pattern 

Similar Programs:

Also See:

Venkatesh Macha

Hi Guys, I am Venkatesh Macha. I am a programmer and an Open Source enthusiast, Presently working as a Software Engineer. Apart from that, I love to explore new technologies and things.

You may also like...

Leave a Reply