Thread
:
Pascal Triangle
View Single Post
#
3
(
permalink
)
November 15th, 2005, 01:43 AM
mistry_bhavin
Authorized User
Join Date: Mar 2004
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
I write the following code ....
but it is not working properly
for(i=0;i<NUMBER;i++)
{
for(j=0;j<=i;j++)
{
printf("%d \t",x(i,j));
}
}
int x(int n, int k)
{
if((k<=0) || (k>=n))
{
return 1;
}
else
{
return x(n-1,k) + x(n-1,k-1);
}
}
mistry_bhavin
View Public Profile
Find all posts by mistry_bhavin