#decimal point

11 messages · Page 1 of 1 (latest)

vale mossBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

cedar basin
#

so given 128.234, would the answer be 8?

#

if this is the case, you would break the problem down into two steps. 1) get the integer part of the decimal, and 2) get the last digit of this number

rich frigate
#

why spoil the fun of finding the answer on their own when they only asked for guidance PES_Hands

#

you both should remove your answers @grand hound @cedar basin

gritty olive
#
#include <iostream>

int main(int, char**) {
    std::cout << ((int)128.234) % 10 << std::endl;
}
soft troutBOT
#
Critical error:

Unsupported language: cc

soft troutBOT
gritty olive
cedar basin
#

then you would use modf to get fractional component. multiply by 10 and cast to an int

vale mossBOT
#

This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.