/********************************/ /* abs.c */ /* Get the absolut value */ /* EECS10 Discussion week2 S1 */ /* Author: Weiwei Chen */ /* Date: Jul. 8. 2012 */ /********************************/ #include int main(void) { int x = -3; int y = 0; int x_orig; x_orig = x; if(x < 0) { x = -x; } y = x; printf("The absolute value of %d is %d.\n", x_orig, y); x = 4; x_orig = x; if(x < 0) { x = -x; } y = x; printf("The absolute value of %d is %d.\n", x_orig, y); return 0; }