Modulus function (not %)

How can we access the mod function in programming. a mod function is a function which returns positive value out of it only.

yes there is a function abs() which takes a single parameter and returns the absolute value of parameter

eg:-

cout<<abs(-1000)<<endl;  // output :: 1000
cout<<abs(1000)<<endl;  // output :: 1000

you can learn more about it here : http://www.cplusplus.com/reference/cstdlib/abs/

In case of any doubt feel free to ask :slight_smile:
mark your doubt as resolved if you got the answer