Function name : abs
Header file : <math.h>
Function prototype : int abs(int i);
Function : Find the absolute value of an integer
Parameters : int i is an integer value
Return value : Returns the absolute value of i
Program example : Find the absolute value of an integer number and output the result
#include<math.h>#include<stdio.h>intmain(void){intnumber=-1234;printf(number:%dabsolutevalue:%dn,number,abs(number));return0;}
Running results:
number:-1234absolutevalue:1234