how to find absolute difference in c++ code example
Example 1: abs in cpp
int a =4;
int b =5;
int ans = abs(a-b); //ALWAYS RETURN POSITIVE NUMBER.
Example 2: absolute difference c++
val1 = abs(22);
val2 = abs(-43);
cout << "abs(22) = " << val1 << "\n";
cout << "abs(-43) = " << val2 << "\n";