Your problem is with the mathematics.
If you want to calculate the final price (the discount deduced from the original price), then
finalamount = originalprice*discount;
is not the right thing to do.
The correct mathematics would be
float finalamount = originalprice * (1.0f - discount);
, where discount >= 0.0 and discount <= 1.0 (that is a floating-point number between 0.0 and 1.0; if you want percentages, you should divide by 100).
And as TN CODER suggested, use floats so you can calculate fractions, not just the whole (integral) parts.