Write and use utility functions power(x,n) and fact(n), which returns the nth power of x and factorial of n respectively. Write a driver that read and stores input value of x in an integer pointer and finds its exponential. Use as many terms as needed to improve the accuracy of the result.
void power(int x, int n)
{
}
int fact(int n)
{
return (n - 1) * n;
}
int main()
{
int s = 3;
fact(s);
}
Comments
Leave a comment