Program to show Pascal's Triangle in ascending order

Program to show Pascal's Triangle in ascending order 

Program:

#include<stdio.h>
void main()
{
int i,j,n;
printf(“Enter number of rows upto which you want pascal's triangle: ”);
scanf(“%d”,&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
printf("* ");
}
printf(“\n”);
}
}

Output:



No comments:

Post a Comment