/* =========================================================
   File   : simple.c
   Purpose: Calculate growth of money using simple interest
   Author : Lew Baxter
   Date   : 2010-01-10
   ========================================================= */

#include <stdio.h>

main()
{
   double principal, rate, interest, amount;
   int numberYears;

   /* print title and ask user for principal, rate and years */

   printf("=== Simple Interest Calculator ===\n");
   printf("Enter Principal         : $");
   scanf("%f", &principal);
   printf("Enter Rate [%%]          : ");
   scanf("%f", &rate);
   printf("Enter number of years   : ");
   scanf("%d", &numberYears);

   /* calculate interest and add to principal */

   interest = principal * rate/100.0 * numberYears;
   amount = principal + interest;

   /* print final amount */

   printf("Your money will grow to : $%.2f\n", amount);
}