Write a program to input sell price and cost price and find transaction is profit or loss.

About Program 
In this program we input sell price and cost price of a product and calculate what happened in this transaction, profit or loss.
For this we need a condition which describe in if block. If sell price is greater than cost price then transaction is profit else loss.

#include<stdio.h>
#include<conio.h>
void main()
{
int sp,cp;
clrscr();
printf("Enter sell price and cost price=");
scanf("%d%d,&sp,&cp);
if(sp>cp)
 printf("\nTransaction in Profit");
else 
 printf("\nTransaction in Loss");
getch();
}

OUTPUT 
Enter sell price and cost price=500
400
Transaction in Profit
              OR
Enter sell price and cost price=400
500
Transaction in Loss

Related Examples 

  1. Write a program to input age of any person and check he is eligible for voting or not.
  2. Write a program to input a number and check number is odd or even.
  3. Write a program to input two number and find smallest number.
  4.  Write a program to input two number and find highest number. 

    1.  Share and Comment. 
      Follow for recently updates. 

    Comments

    Popular posts from this blog

    Write a program to input age of any person and check he is eligible for voting or not.

    Write a program to input two digit number and check number is palindrome or not.

    Write a program to input speed of Royal Enfield and check it's running at economic speed or not.