Loading...
Select Version
&pagelevel(4)&pagelevel
Definition | #include <stdlib.h> int abs(int i);
|
Return val. Note |
The absolute value of the highest presentable negative number cannot be presented. If the |
Example | The following program outputs the absolute value corresponding to an input value. #include <stdio.h> #include <stdlib.h> int main(void) { int i; printf("Please enter int value: \n"); if (scanf("%d", &i) == 1) /* Checks number of entries */ printf("i = %d; ?i? = %d\n", i, abs(i)); else printf("Input error! \n"); return 0; } |
See also | cabs, fabs, labs, llabs |