int main()
{
Floating point numbers b, s, a 1, a2, a3;
printf(" cost = \ n ");
scanf("%f ",& ampb);
printf(" Price = \ n ");
scanf("%f ",& amps);
a 1 = s * 0.03-b;
Printf ("profit =%f", a1);
}
If it is plastic, the input will round off the output, resulting in the loss of the decimal part, so the floating-point type can be used to solve this problem, and there is another problem: a1= s * 0.03-b; Isn't profit the selling price minus the cost? Why multiply it by 0.03? This usually comes out negative ~