#"C"#Program#to#make#Pascal's#Triangle
Easy and simple way to make a Pascals Triangle in turbo C++
#include<stdio.h>
void main( )
{
int row,col,space,n,no;
clrscr( );
printf("enter the number of rows");
scanf("%d",&no);
for (row=0;row<no;row++)
{
for (space=0;space<(no-row);space++)
{
printf(" ");
}
n=1;
for(col=0;col<=row;col++)
{
printf(" ");
}
n=1;
for (col=0;col<=row;col++)
{
printf( " %d",n);
n=n*(row-col)/(col+1);
}
printf("/n");
}
getch( );
}
keep shining dear
ReplyDeletePost a Comment
thank u so much
love 3