0
How to display decimal points number in c++
2 Réponses
+ 18
For displaying floating point numbers tou can directly use
float pi =3.141;
cout << pi;
But if you want to display floating point numbers till a specific limit then, you can use the C++manipulator precision which defines the minimum precision.
You can refer the below code for more detail :
https://code.sololearn.com/cdW2GlpEHgZS/?ref=app
0
A=3,B=5,C=2;
Avg=(A+B+C)/3;
//i want result is 3.333
cout <<Avg;