> Hi i have to program a code to perform 1 of 5 functions at the users
> request, I have got to the part where i have to program the equations
> and i cant seem to get them to link together. Basicly when the used
> enters his radians i was to link to a sin x function to calculate the
> sin of the number also there will be a factorial function and a cos
> function. but none of them are linking.
Hi,
It would be helpful if you include the actual error messages.
We are not yet clairvoyant.
If you do math you should also include math.h.
Look in MSDN to see which functions are contained in which library.
There should be no need to program sin and cos functions yourself.

Signature
Kind regards,
Bruno van Dooren
bruno_nos_pam_van_dooren@hotmail.com
Remove only "_nos_pam"
> Hi i have to program a code to perform 1 of 5 functions at the users
> request, I have got to the part where i have to program the equations
> and i cant seem to get them to link together. Basicly when the used
> enters his radians i was to link to a sin x function to calculate the
> sin of the number also there will be a factorial function and a cos
> function. but none of them are linking.
You should have asked your professor first, he/she is paid to help you.
> #include <iostream>
>
[quoted text clipped - 12 lines]
> double sin=0;
> double x=0;
Local variable x, always zero
> sin=x-(x*x*x/(3*2*1))+(x*x*x*x*x/(5*4*3*2*1));
Reusing the name "sin", bad idea.
x = 0, hence sin = 0
> return sin;
always 0
> }
>
> int main()
> {
> int item=0;
> double x=0;
Another local variable x, distinct from the one in sin().
> double pi=3.14159265;
>
> cout <<"Please enter your x value in radians : ";
> cin >> x;
This x changes.
> cout <<"Select the Equation to Perform:";
> cout <<"\n";
[quoted text clipped - 9 lines]
> case 1:
> cout <<sin();
This always prints 0.
> cout <<"\n\n\n";
> break;
[quoted text clipped - 24 lines]
> Posted via http://www.codecomments.com
> ------------------------------------------------------------------------
> Hi i have to program a code to perform 1 of 5 functions at the users
> request, I have got to the part where i have to program the equations
> and i cant seem to get them to link together. Basicly when the used
> enters his radians i was to link to a sin x function to calculate the
> sin of the number also there will be a factorial function and a cos
> function. but none of them are linking.
[snip]
Well, for starters you should be passing the value of x to the functions
as an an argument. The x in your main() is a local variable, so there is
no way the functions can see it (and global variables in C++ are bad
anyway).
What do you mean by "not linking" ?
David Wilkinson