Your program should accept two values from the user (the angle x and the value of n) and then should compute and print the value of sin(x).
To make the program, do following tasks.
Write two functions, i.e. function to calculate factorial and function to calculate power having following prototypes.
double Factorial (int n); //Factorial function prototype
double Power(double x, int y); //Power function prototype
Use these functions in your main function to compute the series.
Till now, I've written the following program but I am not able to get the right answer.
#include <iostream>
using namespace std;
double fact (int f); //declaration of factorial function
double power(double x, int y); //declaration of power function
int main()
{
int x=0; //value of x in the series
float sum_pos = 0;
float sum_neg=0;
float t_sum=0;
cout << "Enter the value of x: " << endl;
cin >> x;
Bookmarks