Skip to content

Commit

Permalink
6-abs.c
Browse files Browse the repository at this point in the history
  • Loading branch information
victorpreston committed Jun 20, 2023
1 parent a18c009 commit 6065582
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions 0x02-functions_nested_loops/6-abs.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include "main.h"
/**
* _abs - computes the absolute value of an integrer
*
* @n: the int to check
*
* Return: the absolute value of int
*
*/
int _abs(int n)
{
if (n >= 0)
{
return (n);
}
return (-n);
}

0 comments on commit 6065582

Please sign in to comment.