here is my source code and i need to have these:
1.pascal triagnle of a certain degree n (x+y)^n
2.specific line of pascal triangle of a certain n (x+y)^n
3.Rth term coefficient of pascal triangle (ax+by)^n
#include%26lt;stdio.h%26gt;
int main()
{
int row,c,n,x;
void pasc(int);
printf("\n\nEnter the no. of rows: ");
scanf("%d",%26amp;row);
printf("\n\n\n");
printf("\nPascal's triangle :\n\n\n");
for(n=0;n%26lt;row;n++)
{
for(c=row-n;c%26gt;=0;c--)
printf(" ");
pasc(n);
printf("\n\n");
}
}
void pasc(int n)
{
int r;
long fact(int);
for(r=0;r%26lt;=n;r++)
printf("%3ld ",fact(n)/(fact(n-r)*fact(r)))...
}
long fact(int v)
{
if(v==1||v==0)
return(1);
else
return(v*fact(v-1));
}
thanks a lot!!
love lots!!!
Turbo C++ experts!?!?!?
Richard this link will help you
http://www.cpp4u.com/c++/source_code/res...
dracaena
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment