Ad

Chapter - 1: Getting Started

If the total selling price of 15 items and the total profit earned on them is input through the keyboard, write a program to find the cost price of one item.


Ad
C
Sections
6
Exercises
#include<stdio.h>
#include<conio.h>
int main()
{
	int sp,prof;
	
	printf("Enter the total selling price of the 15 items : ");
	scanf("%d", &sp );//selling price
	
	printf("\nEnter the total profit on these items : ");
	scanf("%d", &prof );//profit
	
	printf("\nCost price of a single item is %d.", (sp-prof)/15);
	
	getch();
	return 0;
}
Ad

© 2024 Garbage Valuegarbage value logo