A worker takes a job for 5 days. His pay for the day 1 is Rs. X, for day 2 is Rs. 2X and so on. Develop a C program to find the total salary.
1
Expert's answer
2021-07-15T05:19:07-0400
#include<stdio.h>
int main(){
int x;
printf("Enter the salary of one day\n");
scanf("%d", &x);
float salary = x + 2 * x + 3 * x + 4 * x + 5 * x;
printf("The total salary is \t%f", salary);
}
Comments
Leave a comment