Program:
echo "input nthe cost price of an item"
read cop
echo "input the selling price of the item"
read sop
if test $cop -eq $sop
then
echo "no profit or no gain"
fi
if test $cop -gt $sop
then
s=`echo $cop - $sop |bc`
echo " u obtained loss of rs:$s"
else
s=`echo $sop - $cop |bc`
echo "u obtained profit of rs:$s"
fi
Input/OutPut
input nthe cost price of an item
5000
input the selling price of the item
7000
u obtained profit of rs:2000
input nthe cost price of an item
7000
input the selling price of the item
5000
u obtained loss of rs:2000
No comments:
Post a Comment