need help

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <stdio.h>
#include <math.h>

int main()
{
	int i, n;
	float  x, val, sum, t;

	printf(" Enter the value for x : ");
	scanf_s("%f", &x);

	n = 10;
	val = x;
	x = x * 3.14159 / 180;
	t = x;
	sum = x;


	for (i = 1; i < n + 1; i++)
	{
		t = (t * pow((double)(-1), (double)(2 * i - 1)) * x * x) / (2 * i * (2 * i + 1));

		sum = sum + t;
	}


	printf("\nsine value of %f is : %8.4f\n", val, sum);

	getchar();
	getchar();

	return 0;
}
What errors are you receiving or what isn't doing what you want it to?
i can private message you the code again
Or you could answer the question.

I mean... you've just dumped some code here, with no explanation of what it's for, what you want it to do, or what problems you're having with it. What are we supposed to do? How are we supposed to help, when you tell us nothing about what it is you want help with?
oh sorry

this code should give options to change from radiant to degrees and viceversa
with the user inputting the x value

the code has been changed a little
change from radiant to degrees and viceversa


Do you mean radians?

degrees to radians: multiply by pi/180
radians to degrees: multiply by 180/pi.

yeah bit am getting an external error
Topic archived. No new replies allowed.