abs
program computes a value (:the absolute value of x
) and can be improved by using a return
. The value returned can then be used in any integer expressionint abs() {
int x = -12;
if (x<0) { x=-x; } else {}
//printf("%i",x);
return x;
}
int main() {
printf("%i", abs() );
}