AbsI
The absolute value of the given value
Parameters
- int value
The value to find the absolute value of.
Return value
int -
The absolute value of value
Examples
- Example #1: Function definition
int AbsI(int value) {
if (value < 0) {
return -value;
} else {
return value;
}
}
- Example #2: Sample Usage
AbsI(5); // 5
AbsI(-5); // 5
You must login to post a comment. Don't have an account? Register to get one!
Facts
- Date created
- Mar 10, 2010