Chapter: Decision Control Structure /* C (a)If cost price and selling price of an item is input through the keyboard, write a program to determine whether the seller has made profit or incurred loss. Also determine how much profit he made or loss he incurred.*/ #include <stdio.h> //header file #include <conio.h> //header file int main() //main function.. starting of c code { int cp,sp,check; printf("enter cost price: "); scanf("%d",&cp); printf("\nenter selling price:"); scanf("%d",&sp); check=sp-cp; if(check>0) { printf("\nSeller have profit"); printf("\nHe got %d profit",check); } else if(check<0) { ...
Comments
Post a Comment