Add ft_is_negative.c

This commit is contained in:
tosu 2023-03-17 01:07:58 +01:00
parent 18df1442cc
commit 92dc1d827f
1 changed files with 35 additions and 0 deletions

35
ex04/ft_is_negative.c Normal file
View File

@ -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);
}
*/ ////