Originally Posted by pam
Thanks for the reply, but I have made a terrible blunder here. What actually I want to do with the program is, get an output in double data type not double integer. As I mentioned earlier the double data type can store any value with a between the acceptable range of 2.2e-308 to 1.8e308. Here this page also says the same in a table:
so as far as I understand a double in C++ should be able to store a value of more than 308 digits right? And this value could be any real number meaning negative or positive with /without decimal points. So with this program I am just trying to test whether I can add two numbers and the their total could be processed by the compiler considering the fact that both the numbers (double data type) are fairly large and try to get as close as possible to the limit of the double data type ie 2.2e-308 to 1.8e308. I also want the result to be displayed as a number with all the zeroes in it (no matter how many there are 100, 200, 300 or more than that) rather than something like this 1.0001e+271. How do I achieve this? Please tell me if I am doing it right. Thanks a lot.
using namespace std;
double microsoft=1(followed by 308 zeroes).00;
// something like 100000000000.00
cout<<"The total is: "<<total<<" dollars\n";