-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_is_negative.c
30 lines (27 loc) · 1.04 KB
/
ft_is_negative.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_is_negative.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: nkuzminy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/14 14:32:14 by nkuzminy #+# #+# */
/* Updated: 2022/07/14 14:32:17 by nkuzminy ### ########.fr */
/* */
/* ************************************************************************** */
#include<unistd.h>
void ft_is_negative(int n)
{
char pos;
char neg;
pos = 'P';
neg = 'N';
if (n >= 0)
{
write(1, &pos, 1);
}
else
{
write(1, &neg, 1);
}
}