C Language
#include<stdio.h> #include<conio.h> void main( ) { int c, s, Profit, Loss; clrscr( ); printf("Enter Cost Price = "); scanf("%d",&c); printf("Enter Selling Price = "); scanf("%d",&s); Profit = s - c; Loss = c - s; if (s>c) { printf("Profit of Rs. %d", Profit); } else { printf("Profit of Rs. %d", Loss); } getch( ); } /*OUTPUT*/ Enter Cost Price = 1000 Enter Selling Price = 1200 Profit of Rs. 200