title: How to convert int to Double in C programming
body: <pre><code>int num1, num2;
  </code></pre>
  
  <p><code>double average;</code></p>
  
  <pre><code>average=(double)(num1+num2)/2;
  printf("average: %d", average);
  </code></pre>
  
  <p>My test printf shows average as: 0 </p>
  
  <p>This is maybe too easy, but I can't see it. My inputs are both "int" and the average is "double" but somehow it is not calculating right ?</p>