title: Recursive algorithm for cos taylor series expansion c++
body: <p>I recently wrote a Computer Science exam where they asked us to give a recursive definition for the cos taylor series expansion. This is the series</p>
  
  <p>cos(x) = 1 - x^2/2! + x^4/4! + x^6/6! ...</p>
  
  <p>and the function signature looks as follows</p>
  
  <pre><code>float cos(int n , float x)
  </code></pre>
  
  <p>where n represents the number in the series the user would like to calculate till and x represents the value of x in the cos function</p>
  
  <p>I obviously did not get that question correct and I have been trying to figure it out for the past few days but I have hit a brick wall</p>
  
  <p>Would anyone be able to help out getting me started somewhere ?</p>