I have a program to find the Sin value of a given value(in radian) . It is working properly , but i want a better program or can u please give me a small explanation about my code . please ...

in my program

n=2; // what is this meaning


void main()
	float x,s=0,term,f;
	int n,k;
	cout<<"Enter the value:";
	term = x;
	while(fabs(s-sin(x))>0.0001 )
		term = term*f;
	cout<<"Sin "<<k<<"="<<s;



Did you actually write this code ?

You can use the sin function from the C++ library ...
(Look here for a reference)

22/7 is a poor approximation of pi.
You are essentially calculating the series x - (x^3)/3! + (x^5)/5! - (x^7)/7! + ... that is why n=2 at start and 2 is added every time 3+2=5 5+2=7 etc.
Don't know why k=x; is needed, for use in output you could use x as well.

>>22/7 is a poor approximation of pi.
Very right.
22/7 =3.14285714
Your program is not doing good. What I meant to say is the aim of the program is not clear.
Moreover, you are using old headers, using void main.
Never use void main http://cppdb.blogspot.com/2009/02/should-i-use-void-main-or-int-main-or.html

I agree with Tux4life post about "Did you actually write this code ? "
As far as the Original problem is concerned sine can be easily calculated by the sin() function in cmath.
It takes radian as its measure.
Tux has already told you that.

Hi friends please help me to find sin value of user input ( in radian) without using sin() from math.h . please

does the user enter 1 value only?

does the user enter 1 value only?

yes only one value