c++ what is abs() code example
Example 1: abs c++
#include <stdlib.h> /* abs */
int main ()
{
int n,m;
n=abs(23); // n=23
m=abs(-11); // m=11
return 0;
}
Example 2: abs in cpp
int a =4;
int b =5;
int ans = abs(a-b); //ALWAYS RETURN POSITIVE NUMBER.