33 lines
1.1 KiB
C
33 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_is_positive.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: Syxpi <admin@syxpi.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2026/02/28 12:12:07 by Syxpi #+# #+# */
|
|
/* Updated: 2026/02/28 12:14:15 by Syxpi ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include <unistd.h>
|
|
|
|
void ft_is_positive(int nb)
|
|
{
|
|
char c;
|
|
|
|
if (nb >= 0)
|
|
c = 'P';
|
|
else
|
|
c = 'N';
|
|
write(1, &c, 1);
|
|
}
|
|
|
|
int main(void)
|
|
{
|
|
ft_is_positive(42);
|
|
ft_is_positive(-5);
|
|
write(1, "\n", 1);
|
|
return (0);
|
|
}
|