| | |
urgent help
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Sep 2008
Posts: 1
Reputation:
Solved Threads: 0
this is the program:
i amsupposed to get a output of 2.000000449 x 10^-10 but i get a output of 2 X 10^-10. i need more decimal places to be shown on the screen.
i did some research and tried this method:
yet it still does not do it. if anyone would respond i would be grateful
C++ Syntax (Toggle Plain Text)
#include <iostream> using namespace std; int main() { double f0, speed, f1; f0 = 2e-10; speed = 75; f1 = ((speed + 6.685e8) * f0) / (6.685e8 - speed); cout << "The return frequency corresponding to 75 miles per hour is " << f1 << endl; return 0; }
i did some research and tried this method:
C++ Syntax (Toggle Plain Text)
#include <iostream> #include <iomanip> using namespace std; int main() { double f0, speed, f1; f0 = 2e-10; speed = 75; f1 = ((speed + 6.685e8) * f0) / (6.685e8 - speed); cout << "The return frequency corresponding to 75 miles per hour is " << f1 << endl; cout.setf(ios::fixed, ios::floatfield); cout.precision(13); return 0; }
Last edited by Narue; Sep 4th, 2008 at 12:44 pm. Reason: added code tags
•
•
Join Date: Jan 2008
Posts: 49
Reputation:
Solved Threads: 2
Maybe you should put
cout.setf(ios::fixed, ios::floatfield);
cout.precision(13);
before you cout your answer?
And please put when you have codes.
I almost can't see your comments.
cout.setf(ios::fixed, ios::floatfield);
cout.precision(13);
before you cout your answer?
And please put
CPP Syntax (Toggle Plain Text)
code here
I almost can't see your comments.
![]() |
Similar Threads
- pls heeeeeeeeelp its urgent. (C)
- Urgent! (C++)
- URGENT: Need help on I/O code! (Java)
- Urgent help (Networking Hardware Configuration)
- Homepage keeps switching back to a porn site (Web Browsers)
- Importing SQL Script File - Urgent !! (Database Design)
Other Threads in the C++ Forum
- Previous Thread: Line count not working....
- Next Thread: Which database to use?
| Thread Tools | Search this Thread |
api array arrays beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion count data database delete desktop directshow dll download dynamic encryption error file forms fstream function functions game getline givemetehcodez google graph gui homeworkhelper iamthwee ifstream input int integer java lib library linkedlist linker linux loop looping loops map math matrix memory newbie news node number output parameter pointer problem program programming project proxy python random read recursion recursive return string strings struct studio temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






