pascal triangle

a[0][0]=1
a[1][0]=1
a[1][1]=1
for i= 1 to n-1
{
for j=1 to i-1
a[i][0]=1

a[i][i]= 1
}



for i = 0 to n -1
{
for sp = n-1-i to 0
print a space


for j= 0 to j=i
print a[i][j]


}


Post a Comment