need help

Dec 18, 2014 at 6:39pm
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;
}
Dec 18, 2014 at 6:49pm
What errors are you receiving or what isn't doing what you want it to?
Dec 22, 2014 at 12:14pm
i can private message you the code again
Dec 22, 2014 at 12:25pm
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?
Dec 22, 2014 at 1:08pm
oh sorry

this code should give options to change from radiant to degrees and viceversa
Dec 22, 2014 at 1:08pm
with the user inputting the x value

the code has been changed a little
Dec 22, 2014 at 1:59pm
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.

Dec 22, 2014 at 3:35pm
yeah bit am getting an external error
Topic archived. No new replies allowed.