Add files
This commit is contained in:
32
ft_is_positive/ft_is_positive.c
Normal file
32
ft_is_positive/ft_is_positive.c
Normal file
@@ -0,0 +1,32 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* 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);
|
||||
}
|
||||
BIN
ft_is_positive/ft_is_positive.exe
Normal file
BIN
ft_is_positive/ft_is_positive.exe
Normal file
Binary file not shown.
Reference in New Issue
Block a user