I got some problems . I input a=5.999 with d=1 and expected output is 6 but its output is 6.0. I mean I want to delete .0 in my output if it had.
Example: Input:
a=3.864361,d=3,Output expected: 3.864/ Input:a=5.9577,d=1 Output expected: 6/ Input:
a=0.07266,d=3,Output expected:0.073.
#include <iomanip>
using namespace std;
int main()
{
float a;
int d;
cin>>a>>d;
cout<<setprecision(d)<<fixed<<a;
return 0;
}