Can anyone help me with pascals triangle . I got it to do a factorial number , now it want to display the results in a pyramid.
#include <iostream>
using std::cout ;
#include <iomanip>
using std::setw ;
long int factorial(const int);
int main()
{
long int k = factorial (5) ;
cout << setw(20) << " 5! = " << k << "\n" ;
return 0 ;
}
long int factorial(const int n) {
//cout << "fact(" << n << ") = " ;
long int m ;
if (n==0)
return 1 ;
m = n * factorial (n-1) ;
//cout << m << "\n";
return m ;
}
long int combination(int i, int j){
long int p;
p= factorial(i)/factorail(j)*factorial(i-j);
return p;
}
thnks