#include <cmath>#include <iostream> int main(){ std::cout << "10 mod 3 = " << fmod(10, 3); std::cout << "\n10 mod 2.4 = " << fmod(10, 2.4);}
Standard input is empty
10 mod 3 = 1 10 mod 2.4 = 0.4
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!