Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <unistd.h>
- int ft_putchar(char c)
- {
- write (1, &c, 1);
- return 0;
- }
- void ft_putnbr(int nb)
- {
- if (nb == -2147483648)
- {
- ft_putchar ('-');
- ft_putchar ('2');
- ft_putnbr (147483648);
- }
- else if (nb > 9)
- {
- ft_putnbr(nb / 10);
- ft_putnbr(nb % 10);
- }
- else
- {
- ft_putchar(nb + '0');
- }
- }
- int main(){
- int a = -2147483648;
- ft_putnbr(a);
- }
Advertisement
Add Comment
Please, Sign In to add comment