fork(4) download
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. int main()
  5. {
  6. double number = 123.4;
  7. double integer;
  8. double fraction = modf( number, & integer );
  9.  
  10. std::cout << int( fraction * 10.0 ) << std::endl;
  11. }
Success #stdin #stdout 0s 2728KB
stdin
Standard input is empty
stdout
4