Need Help With Function

#include <stdio.h>
#include <math.h>
#define PI 3.14159265
void main(void)
{
float calculate_Sine_Cosine_Tangent(float param);
int result1, result2,result;
float param;
printf("Please Enter in degree");
scanf("%d",&param);
}

float calculate_Sine_Cosine_Tangent(float param)
{
float result, result1, result2;
result = tan (param*PI/180);
result1 = sin (param*PI/180);
result2 = cos (param*PI/180);
if (param<=45){
printf ("The tangent of %lf degrees is %lf.\n,The sine of %f degree is %f\n,The Cosine of %f degrees is %f\n",
param, result,param,result1,param,result2 );
}
else{
printf ("The tangent of %lf degrees is Math Error.\n,The sine of %f degree is %f\n,The Cosine of %f degrees is %f\n",
param,param,result1,param,result2 );
}
return 0;
}
I need help with this function >.<
i have no idea where went rong>.<
float calculate_Sine_Cosine_Tangent(float param)
Infinityyyyyyyy!!

Frozendog11 wrote:
I need help with this function >.<
i have no idea where went rong>.<

So you're saying you're...'out of your vector'?

Attention all yoctograms! Use [code][/code] tags around your code! It preserves it beauty!

Why does the calculate function return anything when all it will return is 0? Functions with useless return values are garbage!
CRUNCH!
I'll add them to the heap!

[waits while heap is rebuilt]

You need to call the function properly.
http://cplusplus.com/doc/tutorial/functions/
XOR yourself out of here, and recur once you've taken the limit as U go to infinity!

Forgive me.
#include <stdio.h>
#include <math.h>
#define PI 3.14159265
void main ()
{
float param;
float Tangent(float x);
printf( "Enter degree(x)");
scanf("%f",&param);
}
float Tangent(float param)
{
float answer;
answer = (param*PI/180);
if(answer = 90 )
{
return 0;
}
else
{
return tan(answer);
}
}
i have a return value but oso cant work >.<
Topic archived. No new replies allowed.