Star Triangle Ascending (LTR)

By Developgram - January 10, 2017

/*
Summary: Print stars in ascending order from left to right
*/

#include<stdio.h>

int main()
{
    int row, col, n;

    printf("Enter the number of rows: ");
    scanf("%d", &n);

    for(row=1; row<=n; row++)
    {
        for(col=1; col<=row; col++)
            printf("* ");
        printf("\n");
    }

    return 0;
}

  • Share:

You Might Also Like

0 comments