Answers for "how to use math.abs in cpp"

C++
5

abs c++

#include <stdlib.h>     /* abs */

int main ()
{
  int n,m;
  n=abs(23); // n=23
  m=abs(-11); // m=11
  return 0;
}
Posted by: Guest on March-02-2021
3

abs in c++

#include <cmath>
abs(number);
Ex: abs(-10) = |-10| = 10
Posted by: Guest on June-05-2021

Browse Popular Code Answers by Language