Hi everybody, I'm new here. I have a question. I noticed an "error" in this simple program that I wrote to start my experience in c++ :
#include <iostream>
using namespace std;
int main()
{
int counter;
double Mpound, Epound;
counter = 0;
for(Epound == 1; Epound <= 100; Epound++) {
Mpound = (Epound / 100) * 17;
cout << Epound << " pound on the Earth is " << Mpound
<< " on the moon\n";
counter++;
if(counter == 25) {
cout << "\n";
counter = 0;
}
}
cout << "\n";
system ("PAUSE");
return 0;
}
When i compiled it and run it, at the top of the prompt there is one string:
"6.43705e-308 pound on the Earth is 1.0943e-308 on the moon" that i don't wrote!
I use Dev-C++ as IDE and compiler. Anyone can help me?
to Spoking & Athar : I'm following the guide of Herbert Schildt and I'm at module 1, and I didn't "studied" float, only double, but thank you for your advise.