I have a simple function in C++.
float numret()
{
return 10.00;
}
int main()
{
float a;
a = numret();
cout<<a;
}
This output value is 10 but it should be 10.00 as returned by the function. How can I make sure it is returning 10.00. I have also tried returning from a variable like this
float numret()
{
float maxval = 10.00;
return maxval;
}
but still I am getting 10 as output.