title: Approximating the value of pi in C using Viete's Formula
body: <p>My assignment this week in my CS class is create a program to approximate for pi using Viète's Formula. I've been trying to start for the past hour or so, but I'm honestly not even sure how to begin. All the work I have gotten done doesn't work.</p>
  
  <p>I'm assuming my professor wants us to use the "while" loop, as we've been using it a lot in class lately. We've also been using "if" statements a lot, although I'm not sure if we need to use those here. </p>
  
  <p>Can anyone help me find a starting off point or explain how I could go about doing this? </p>
  
  <pre><code>//here is some of the work i have attempted that doesn't work because i don't know what to do
  #include &lt;stdio.h&gt; 
  #include &lt;math.h&gt; 
  #include &lt;stdlib.h&gt; 
  
  int main() 
  
  { 
  double n,pi,f,i; 
  
  printf("enter the number of iterations to approximate for pi\n"); 
  scanf("%lf\n", &amp;n); 
  
  pi = 2 / f; 
  i = 1; 
  f = sqrt(2);
  
  while (i&lt;=n)
  { 
  
  
  
  }
  </code></pre>