This is my new code. I am getting errors on lines 16, 17 and 20. error: expected expression before 'char'
Is my math allowed on lines 17 or 20?
Also, when i run the code, the scanf function does not recieve input on a new line. It is on the same line as the second question. How can i make the input flashing _ appear under the second question
Code:
#include <stdio.h>
#include <math.h>
#include <string.h>
int main()
{
double degrees;
double answer;
char text[4];
double PI = 3.14159265358979323846264338327;
printf ("\n Would you like to compute a sin or cos function? \n");
fgets( text, 4, stdin);
printf("\n How many degrees does the angle have?" \n);
scanf (" %f ", degrees );
if (char text = sin){
answer = sin(char text*180/(double PI));
}
else {
answer = cos(char text*180/(double PI))
}
printf("\n %.2f \n", answer );
return 0;