```
# include <iostream>
# include <math.h>
# include <cstdlib>
using namespace std;

double cosin_value( double value);
double sin_value( double value);
double big_degree (double value);
double big_radian (double value);
double x;
double value;
double degree;
double radian;
const double PI = 3.14159;

char choice;
char yes ;

int main()
 {
cout << "Please enter an angle value => ";
cin >> value;

cout << "Is the angle in Degree or Radian?" << endl;
        cout << "\t" << "Type D if it is in Degree" << endl;
        cout << "\t" << "Type R if it is in Radian" << endl;
        cout << "Your response => ";
        cin >> choice; //degree or radian?

        cout.setf(ios::fixed);
        cout.setf(ios::showpoint);
        cout.precision(10);

    if (choice == 'D' || choice == 'd')
    {
        big_degree (value);
        cout << " " << "sin(x)   = " << "\t" << sin_value(degree) << endl;
        cout << " " << "cos(x)   = " << "\t" << cosin_value(degree) << endl;
        cout << " " << "tan(x)   = " << "\t" <<  sin_value(degree)/cosin_value(degree) << endl;
    }
    else if (choice == 'R' || choice == 'r')
    {   
        cout << " " << "sin(x)   = " << "\t" << sin_value(radian) << endl;
        cout << " " << "cos(x)   = " << "\t" << cosin_value(radian) <<  endl;
        cout << " " << "tan(x)   = " << "\t" <<   sin_value(radian)/cosin_value(radian) << endl;
    }   
    return 0;
}

// Sine,cosine functions
// angle -360<value<360

double sin_value( double value)
{
int count=1;

double sine, num, dem, sign, term;
sine=0;
sign = 1;   
num = value;
dem = count;

while ( count <= 20 )
{
    term = (num/dem);
    sine = sine + term*sign;
    num = num*value*value;
    count = count + 2;
    dem = dem * count * (count-1);
    sign = -sign;

}
return (sine);  
}   

double cosin_value( double value)
{
int count=0;
double cosine, num, dem, sign, term;
cosine=0;
sign = 1;

num = 1;
dem = 1;

while ( count <= 20 )
{
    term = (num/dem);
    cosine = cosine + term*sign;
    num = num*value*value;
    count = count + 2;
    dem = dem * count * (count-1);
    sign = -sign;
}
return (cosine);
}   

double big_degree (double value)
{
int result;
const int angle=360;
if (value >= 360 || value <= -360)
{
    result=value/angle;
    degree=(value-(result* angle))*PI/180;
}    
else
{
    degree = (value*PI)/180;
}   
return (degree);
 }  

double big_radian (double value)
{
int result;

if (value >= 2*PI || value <= -2*PI)
{
    result=value/(2*PI);
    radian=(value-(result* 2*PI));
}    
else
{
    radian = value;
}   
return (radian);
}   

```

Hi, this is basically the whole program I wrote for calculating trigonometric value using the extent knowledge I knew in C++ as a beginner. For a better view, you can refer to this link regarding my code above :[codepad.org](http://codepad.org/dChy8x2E)
the line starting from line 114 onwards are the function that I created. There's a problem there where how can I compute my **cosx** to be 0 when the value is 90 degree or pi/2 radian?
since the program will still calculate **tanx** for me even the value is 90 degree.
Let's say by giving value **90 degree** to the program, it will give me the value of **0.0000013268** instead of **0.000000**
sorry, since I'm just a beginner, the code will look weird for you guys.
I appreciate your guides!
**double big\_degree(double value)** means when the **value is >= 360 or <= -360\***