Program in C To Print Right Triangle Star Pattern

Errorlogger
0
/* 1. Program to print the following output
*
  **
    ***
      ****
        *****
*/

#include <stdio.h>
int main()
{
    int i, j;
    for(i=1; i<=5; i++)
    {
        //Print i number of stars
        for(j=1; j<=i; j++)
        {
            printf("*");
        }
        //Move to next line/row
        printf("\n");
    }
    return 0;

}




Post a Comment

0Comments

Post a Comment (0)

#buttons=(Accept !) #days=(30)

Our website uses cookies to enhance your experience. Check Now
Accept !