title: Convert int to double
body: <p>I ran this simple program, but when I convert from <code>int</code> to <code>double</code>, the result is zero.  The <code>sqrt</code> of the zeros then displays negative values.  This is an example from an online tutorial so I'm not sure why this is happening. I tried in Windows and Unix.</p>
  
  <pre><code>/* Hello World program */
  
  #include&lt;stdio.h&gt;
  #include&lt;math.h&gt;
  
  main()
  
  {  int i;
  
     printf("\t Number \t\t Square Root of Number\n\n");
  
     for (i=0; i&lt;=360; ++i)
          printf("\t %d \t\t\t %d \n",i, sqrt((double) i));
  
  
  }
  </code></pre>