Add ft_is_negative.c
This commit is contained in:
parent
18df1442cc
commit
92dc1d827f
|
@ -0,0 +1,35 @@
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ft_print_reverse_alphabet.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2023/03/15 21:50:37 by tischmid #+# #+# */
|
||||||
|
/* Updated: 2023/03/16 05:00:01 by tischmid ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
void ft_is_negative(int n)
|
||||||
|
{
|
||||||
|
if (n < 0)
|
||||||
|
{
|
||||||
|
write(1, "N", 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
write(1, "P", 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ////
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
ft_is_negative(5);
|
||||||
|
ft_is_negative(0);
|
||||||
|
ft_is_negative(-5);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
*/ ////
|
Loading…
Reference in New Issue