For Advertisements on this blog Contact Us at developgram@gmail.com or +91-9923438816

Simple Programming Tutorials For Beginners

Tuesday, January 10, 2017

Star Triangle Descending (LTR)

/*
Summary: Print stars in descending 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=n; row>=1; row--)
    {
        for(col=1; col<=row; col++)
            printf("* ");
        printf("\n");
    }

    return 0;
}

No comments:

Post a Comment

SEARCH THIS BLOG