Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Write a program to print the following triangle for n lines : GTU Nov-Dec 2010

Write a Program to print the following triangle for n lines.


*
* *
* * *
* * * *
 
#include
#include

main()
{
    int number,i,j;
    clrscr();
    printf("\n Enter Number : ");
    scanf("%d", &number);
    printf("\n\n");
    for(i=1; i    {
        for(j = (number - 1);j>=i;j--)
            printf(" ");
        for(j=1;j            printf("* ");
        for(j = (number - 1);j>=i;j--)
            printf(" ");
        printf("\n");
    }
    getch();
}


This post first appeared on Ask For Program, please read the originial post: here

Share the post

Write a program to print the following triangle for n lines : GTU Nov-Dec 2010

×

Subscribe to Ask For Program

Get updates delivered right to your inbox!

Thank you for your subscription

×