01: #include <stdio.h>
02:
03: float abs(float x); //absolute
04:
05: int main(void)
06: {
07: float x, z;
08:
09: printf("Input: ");
10: scanf("%f", &x);
11: z = abs(x);
12: printf("|%f| = %f", x, z);
13:
14: return 0;
15: }
16:
17: float abs(float x)
18: {
19: if(x < 0) x = -x;
20: return -x;
21: }