I don't know the reason why the float doesn't print exact value when I execute this program.
#include <iostream>
using namespace std;
int main(){
int a, b;
float x;
cout << "Input the value for a: ";
cin >> a;
cout << "Input the value for b: ";
cin >> b;
x = - b / a;
printf("The value of x is: %.2f",x);
//cout << "The value of x is: " << x;
}
I want to at least when I input 2 for a and 10 for b the result should be 0.20, the program shows 0.00 only