Monday, 24 August 2015

Write a C Program to Print Triangle Patter Program

#include<stdio.h>
#include<conio.h>

int main()
{
            int i,n,j,k;
            clrscr();

            printf("Enter  the number : ");
            scanf("%d",&n);
            printf("\n");
            for(i=0;i<n;i++)
            {
                        for(k=1;k<=i;k++)
                        {
                                    printf(" ");
                        }
                        for(j=1;j<=n-i;j++)
                        {
                                    printf(" %c",96+j);
                        }
                        printf("\n");
            }

            getch();

return 0;
}                                                                                                                    


No comments:

Post a Comment