For the following code:
#include <iostream>
using namespace std;
class Hall
{
public:
double cost;
};
int main()
{
Hall hall;
hall.cost=10000.50;
cout<<hall.cost;
return 0;
}
Why does this code output 10000.5 and not 10000.50, can someone explain the logic behind this?