Print Profit & Loss In C Programming

preview_player
Показать описание
This Video is made to Calculate the Profit & Loss in C Programming.............. Hope this Video will be Helpful to u all................
Please Subscribe my channel...for such videos.....
Рекомендации по теме
Комментарии
Автор

Great Video! It's very useful tutorial

sunitathapa
Автор

Y=(SP>CP) ? Profit : Loss
Printf("%d", Y)

learnfrompast
Автор

what if the cost price is equals to the selling price .

shubhankardubey
Автор

i think this will work //#include <stdio.h>

int main()
{
float cp, sp, loss, profit;
printf("enter the cost price of the object\n");
scanf("%f", &cp);
printf("enter the selling price of the object\n");
scanf("%f", &sp);
if(cp==sp)
printf("you are nither in loss nor in profit\n");
else if(cp>sp)
{
printf("you are in loss\n");
loss=cp-sp;
printf("and your loss is = %f", loss);
}
else
{
printf("you are in profit\n");
profit=sp-cp;
printf("and your profit is = %f", profit);
}


return 0;
//

shubhankardubey