My code is too exact? Please help.

NEVERMIND
Last edited on
I am not going give answers, but I would suggest debugging your program. Try working through your program by hand and check your expected values with your debugging values.
Not sure why you deleted your post, Exotath. If you are still looking for an answer, check out stream manipulators.

1
2
3
4
5
6
7
8
9
10
11
12
#include<iostream>
#include <iomanip>
using namespace std;

int main()
{
	cout << fixed << setprecision(2); //this will set your decimal printing to 2 decimal places

	cout << 12.12345;
	cout << '\n' << 424.5754;
	cin.get();
}
Last edited on
Thanks! I just figured that out which is why I said nevermind. Fixed everything!
even if you've figured it out, you shouldn't delete your post... it's probably useful for the others who have the same (bug) problem...
Topic archived. No new replies allowed.