### Infinitely looping a certain piece of my program

Hi I am trying to write a program that requires a repeat to infinity. However I am not sure how to do this I am trying to use the Taylor series to find the sine of an angle and the series is:

sin(x) = x - (x^3)/3! + (x^5)/5! - (x^7)/7!...

This pattern the repeats forever I have tried using a while (true) statement but I cant seem to get that to work how can I get this to work

here is what i have so far

 ``12345678910111213141516171819202122232425262728293031323334`` ``````# include #include using namespace std; int factorial (int x) { if (x ==1) return 1; return ( x * factorial(x-1)); } int main () { double angle; int n = 0; int x = 1; cout << "Please enter the value of the angle in radians"; cin >> angle; cout << "The sine of the angle is " << sin(angle) << endl; cout << "using the taylor series the sine of the angle is " << endl; while (true){ angle - (pow (angle,3+2*n)/(factorial(3+2*n++))) << endl;} return 0; } ``````
while (true){

when you use this syntax, you need to include a
break;

condition otherwise it will never stop....
Topic archived. No new replies allowed.