Answer to Question #217483 in C for Anandharaman

Question #217483
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);
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS