0

Help me there is error by typing setprecision,

include <iostream> using namespace std; int main() { float a =1.123456; cout <<setprecision(7)<< a; } where is problem please tell me and fix it

19th Apr 2018, 4:27 PM
chandrapal singh
chandrapal singh - avatar
4 Respostas
+ 4
Did you #include <iomanip> as I recall the setprecision was defined in that header.
19th Apr 2018, 4:35 PM
Ipang
+ 2
thanks sir
19th Apr 2018, 4:42 PM
chandrapal singh
chandrapal singh - avatar
+ 2
You're welcome, glad if it helps, oh I'm not a Sir : )
19th Apr 2018, 4:44 PM
Ipang
+ 2
chandrapal singh In case you're using the green checkmark to indicate your question is solved, it may be helpful to switch it to Ipang's -- that will put that answer at the top (it also sends a little bonus XP, but primarily this helps show there's an accepted answer in case you get more comments).
19th Apr 2018, 9:56 PM
Kirk Schafer
Kirk Schafer - avatar