I'm new here and also new to the language C using GNU. With that being said I'm looking for guidance. I have been given the task to compute the angle of sine using the Taylor series, I have done the calculations and everything. The problem is, that I can't get anything to print out.I'm having problems with understanding how to get the users' input...compute it in another method..then printing it out. I have a feeling its how I pass my functions. After days of surfing the web and having too much pride to ask my classmates, I'm coming to yall for advice. I'll post my code below! Thanks in advance!
#include<stdio.h>
#include<math.h>
double sine(float a);
int main() {
float x;
printf("Enter angle: \n");
scanf("%f", x);
float angleOfSine = sine(x);
printf("%f", angleOfSine);
}
double sine(float angle) {
float ans, x;
int i;
for(int i =1; i < 10; i++){
}
return (i);
double fact = i *(i -1);
if(i % 2 == 0){
}
else{
return fact;
}
ans = (x - (pow(x,3)/fact)+(pow(x,5)/fact)-(pow(x,7)/fact)+(pow(x,9)/fact));
return ans;
}