Thread: setprecision
View Single Post
Join Date: Jun 2005
Posts: 275
Reputation: andor has a spectacular aura about andor has a spectacular aura about andor has a spectacular aura about 
Solved Threads: 29
andor's Avatar
andor andor is offline Offline
Posting Whiz in Training

Re: setprecision

 
0
  #2
Sep 26th, 2006
Originally Posted by Sashar400 View Post
I have #include<iomanip> header also and it's still not working.I am getting 2 dec places but it's .00 Why is that?Please help.
here is the code
cout << showpoint << fixed << setprecision (2);
cout<<"The Mean is "<<mean<<endl;


also this code is not working ,when I use the [ ] at the end,I am getting an error so I am using () instead but the calculation is incorrect.Please help

float var=((num[0]-mean)*pow(num[0]-mean,2) + (num[1]-mean)*pow(num[1]-mean,2) + + (num[2]-mean)*pow(num[2]-mean,2))/ (num[arraysize-1]);
If you want help you need to post the whole code. Read this
Last edited by andor; Sep 26th, 2006 at 1:59 pm.
If you want to win, you must not loose (Alan Ford)
Reply With Quote