Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <unistd.h>
- void my_putstr(char *str);
- void my_putchar(char c);
- void my_put_nbr(int n)
- {
- int i;
- i = 1;
- if (n == -2147483648)
- {
- my_putstr("-2147483648");
- }
- else
- {
- if (n < 0)
- {
- my_putchar('-');
- n *= -1;
- }
- while ((n / i) >= 10)
- i *= 10;
- while (i > 0)
- {
- my_putchar((n / i) % 10 + '0');
- i /= 10;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement