how I can write a float no up to 2 decimal place or 3 decimal place or many more?
How to write float number up to any decimal place?
hey @garggaurav628, you can use setprecision() present in iomanip.h header file, to get result upto specific number of places.
example:
#include
#include
int main()
{
double d = 122.345;
std::cout << std::fixed;
std::cout << std::setprecision(2);
std::cout << d;
}
output: 122.34
will i study these things in this course?