How to use tgamma() function to compute the gamma function of N in C++

1 Answer

0 votes
#include <iostream>
#include <cmath>

using namespace std;

int main()
{
	cout << "tgamma(0.5) = " << tgamma(0.5) << endl;
	cout << "tgamma(10) = " << tgamma(10) << endl;

	return 0;
}

/*
run:

tgamma(0.5) = 1.77245
tgamma(10) = 362880

*/

 



answered Mar 31, 2016 by avibootz
...