Interest rate program : <p>I am just beginning to learn C. So for practice I decided to write a interest rate calculator but for some reason my calculation always comes out as 0 and I can't figure it out. If you can please take a look.</p>

<pre><code>#include &lt;stdio.h&gt;


main()
{


int time;
float principle, rate, total;

printf("What is your starting amount? ");
scanf(" %f", &amp;principle);
printf("What is your interest rate? ");
scanf(" %f", &amp;rate);
printf("How long do you want to save? ");
scanf(" %d", &amp;time);

total = principle * rate * time;
printf("You will have earned an interest amount of $%d", total);
return 0;
}
</code></pre>
