title: I keep getting 0 as the value of this variable
body: <p>I'm trying to write this program to calculate simple interest on a deposit. It's supposed to add the interest money onto the original deposit. </p>
  
  <p>But it keeps making variable "rate" 0 which is why when I run it, the result is 0. Any help is appreciated.</p>
  
  <pre><code>  #include &lt;stdio.h&gt;
  
  int main(void){
  
      double d;
      double rate;
      double y;
      double final;
      int x;
  
      printf("Enter the deposit: ");
      scanf("%d", &amp;d);
  
      printf("Enter the interest rate (0-100): ");
      scanf("%d", &amp;rate);
  
      printf("Enter the number of years: ");
      scanf("%i", &amp;x);
  
      rate = rate / 100;
  
      y = d * rate * x;
  
      final = d + y;
  
  
      printf("After %i number of years, the deposit in the savings account is now %d", x, rate);
  
  }
  </code></pre>