We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cfb5707 commit c9a0511Copy full SHA for c9a0511
0x02-functions_nested_loops/6-abs.c
@@ -0,0 +1,19 @@
1
+/**
2
+ * _abs - Computes the absolute a value of an integer.
3
+ *
4
+ * @n: the number to be processed.
5
6
+ * Return: absolute value of the integer.
7
+ */
8
+
9
+int _abs(int n)
10
+{
11
+ if (n < 0)
12
+ {
13
+ return (n * -1);
14
+ }
15
+ else
16
17
+ return (n);
18
19
+}
0x02-functions_nested_loops/main.h
@@ -4,3 +4,4 @@ void print_alphabet_x10(void);
int _islower(int);
int _isalpha(int);
int print_sign(int);
+int _abs(int);
0 commit comments