#include <stdio.h>
int main(){
float salary;
float totalSalary=0;
int day=0;
//get the salary of one day
printf("Enter the salary of one day: ");
scanf("%f",&salary);
//find the total salary.
for(day=1;day<=5;day++){
totalSalary+=day*salary;
}
printf("\nThe total salary for 5 days is: %.2f\n\n",totalSalary);
getchar();
getchar();
return 0;
}
Comments
Leave a comment