C++ Program Calculate the Loss and Profit of Seller
#include<iostream>
using namespace std;
int main()
{
int costprice, sellprice, result;
cout<<"Please enter the cost price: \n";
cin >> costprice;
cout<<"Please enter the selling price: \n";
cin >> sellprice;
if (costprice>sellprice)
{
result = costprice - sellprice;
cout<<"\nSeller Loss of rupees: " <<result;
}
if (costprice<sellprice)
{
result = sellprice - costprice;
cout << "\nSeller Profit of rupees: " << result;
}
system("pause");
}
*------------------------------------------------------------------------------------------------------*
#include hum is liya likhta hain taka hum ak header file ko samil kar saka. jasa ke "iostream" is program ma samil kia. header files ko is liya hum istimal karta hai q ka us ma pahla sa he kuch functions ko store karwa lia jata hai. Taka baad ma humay bar bar usay likhna na paray bs us ke header file ko shamil kar ka us function ko call kar lia jae .
0 comments:
Post a Comment