fork download
  1. #include<stdio.h>
  2. #define PRINCIPAL 5000.00
  3. #define PERIOD 10
  4. main()
  5. {
  6. int year;
  7. float amount, interest, value;
  8. amount= PRINCIPAL;
  9. year= 0;
  10. interest=0.5;
  11. while(year<= PERIOD)
  12. {
  13. printf("%2d\t%8.2f\n", year, amount);
  14. value= amount + amount*interest ;
  15. year=year+1;
  16. value=amount;
  17. }
  18. }
Success #stdin #stdout 0.02s 25996KB
stdin
Standard input is empty
stdout
#include<stdio.h>
#define PRINCIPAL 5000.00
#define PERIOD 10
main()
{
int year;
float amount, interest, value;
amount= PRINCIPAL;
year= 0;
interest=0.5;
while(year<= PERIOD)
{
printf("%2d\t%8.2f\n", year, amount);
value= amount + amount*interest ;
year=year+1;
value=amount;
}
}