title: draw a sine wave using c?
body: <pre><code>#include &lt;conio.h&gt;
  #include &lt;math.h&gt;
  #include &lt;graphics.h&gt;
  #include &lt;dos.h&gt;
  
  
  int main() {
  
      int gd = DETECT, gm;
  
      int angle = 0;
  
      double x, y;
  
      initgraph(&amp;gd, &amp;gm, "C:\\TC\\BGI");
  
  
      line(0, getmaxy() / 2, getmaxx(), getmaxy() / 2);
  
      /* generate a sine wave */
  
      for(x = 0; x &lt; getmaxx(); x+=3) {
  
          /* calculate y value given x */
  
          y = 50*sin(angle*3.141/180);
  
          y = getmaxy()/2 - y;
  
          /* color a pixel at the given position */
  
          putpixel(x, y, 15);
  
          delay(100);
  
          /* increment angle */
  
          angle+=5;
  
      }
  
      getch();
  
      /* deallocate memory allocated for graphics screen */
  
      closegraph();
  
      return 0;
  
  }
  </code></pre>
  
  <p>This is the program. Why are we incrementing the angle and how this angle is relevant to graph? I changed the value of angle to 0 and the wave became a straight line. I want to know what is happening with this increment.</p>