Hello,
I was wondering if someone can tell me how I could make the "Press any key to continue...." not appear on my screen when I run my program, or if thats not possible is there a way that I can shift it down with a "\n" because I haven't found a way yet, and it is a bit annoying at times
For example if you compile and run the code below after the last printout of the program it says "Press any key to continue..." and thats what I am trying to either move or get rid of if possible.
Code:
#include <stdio.h>
int main () {
int counter;
float rate, annual_amt_used, will, i;
printf("What was the amount of the inheritance?\n");
scanf("%f", &will);
printf("\nWhat is the the amount you will use each year?\n");
scanf("%f", &annual_amt_used);
printf("\nWhat is the interest rate on the account?\n");
scanf("%f", &rate);
printf("\n\nYear\t Payment\t Money Left\n-----------------------------------\n");
counter=1;
while(will>0)
{
if(will > annual_amt_used)
will= will + ((rate/100)*will) - annual_amt_used;
else
{
annual_amt_used=will + ((rate/100)*will);
will=annual_amt_used-annual_amt_used;
}
printf("%d%15.2f%17.2f\n", counter, annual_amt_used, will);
counter++;
}
system("PAUSE");
return 0;
}
Thank You,
Matt H.