i got a small task to finish n im finish the task already. tq my frend to help me. im juz curious why my equation should be at that place. :confused:
here my code:
#include<stdio.h>
int main()
{
int duration,year;
float courseFee, totalFee=0;
printf("Enter duration of study [year]: ");
scanf("%d", &duration);
printf("\nDuration of study: %d", duration);
printf("\nYear\t\tCourse Fee");
year=1;
courseFee=10000;
while (year<=duration)
{
printf("\n%d\t\t%.2lf", year,courseFee);
++year;
totalFee+=courseFee;
courseFee *= 1.05;
}
printf("\n\nTotal Course Fees: USD%.2f\n", totalFee);
return 0;
}
I already achieve the result of the program.
hope some1 can explain me why im cannot put the equation 'totalFee+=courseFee' below courseFee *= 1.05?
tq. :love:


Sign In
Create Account


Back to top










