Answer to Question #245686 in C for Hemant

Question #245686

You visit a shop to get your assignment typed and printed. WAP to calculate bill of a job work based on following rates.

Rate of typing is Rs. 3/- per page

Printing of fist copy if Rs. 5/- per page and later every copy Rs. 3/- per page.

User should enter the number of pages in assignment and no. of print out copies your group want.


1
Expert's answer
2021-10-02T10:56:01-0400

Let the number of pages be "x" and the number of copies we want be "y" and total price be "p".

Required code is:

#include<stdio.h>
int main() {
 int x,n,p;
 printf("Enter the number of pages in assignment and number of copies you want");
 scanf("%d %d", &x, &n);
 p = 3 * x + (n - 1) * 3 + 5;
 printf("the price for the same is %d rupees", p);
 return 0;
}

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