Computer Science, asked by sskr0106, 22 hours ago

Given a situation, you're going to stationary shop and buying five long size unruled classmate notebooks for writing notes for five different subjects. You paid Rs.500 to the shopkeeper for which the shopkeeper gave back Rs.25 back to you as change.  Write a C program to find the cost of each notebook that you've bought. Give 500 as input to the system using scanf statement.

Answers

Answered by XXThelegendaryXX
1

Explanation:

hth se baat nhi hai na Hshusueu

Answered by Anonymous
0

The C program to find the cost of each notebook is given below:

#include<stdio.h>

int main( )

{

int book, cshop, cost;

printf("Enter the number of books to be bought");

scanf("%d",book); //Variable to accept the number of books

printf ("Enter the amount to be given to the shopkeeper");

scanf("%d",cshop); //Variable to accept the amount to be given which is 500

printf("The cost of each book that have been bought");

cost = (cshop - 25)/book;  //Variable to store the cost of each book

printf("%d",cost);

return 0;

}

Similar questions