0
How to control the number of digits after the decimal point in c++
c++
13 Antworten
+ 6
I don't know about C++ but in C we use %.2f for floating values and%.2lf for double values. 2 here represents no. of digits after decimal.Probably there is a function for this in C++
+ 3
can you share your code so we can check where is the problem ?
+ 2
please read this article http://www.cplusplus.com/forum/windows/181991/
+ 1
please check my simple example for you
https://code.sololearn.com/cw8FZ6U8pNcF/?ref=app
be sure you added #include <iomanip>
+ 1
did you include ? #include <iomanip>
+ 1
yes and it doesn't output any thing for me and the code is correct but with this addition it missed up 😅😅
+ 1
you put that at the top and you get this error???
0
doesn't work melik at all for me
0
error:#include nested too deeply
0
yes
0
even your code when I put it in my code blocks it gives me that error
0
still can't solve this problem and It gives me another error redefinition of int main()
0
even the simplest code when I put #include<iomanip>