c++ - Decimal from Integer and Invalid Operands *Updated -
c++ - Decimal from Integer and Invalid Operands *Updated -
i beginner in c++ , assignment wrote code number english language conversion. problem getting decimal integer. upon advice changed void expand double value , changed code getting decimal, , receive "invalid operands of types double , int binary operator %" remainder of code. (value)?
void expand(double); int main() { ...... } void expand(double value) { string const ones[20] = { " ...... " } if(value>1) { double decimalpart = value - (int)value; } else if(value>=1000) { expand(value/1000); cout<<" thousand"; if(value % 1000) ..... void expand(int value)
change above double work
void expand(double value) also can decimal part lone next after changing above
double decimalpart = value - (int)value; c++ integer decimal operands
Comments
Post a Comment