-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path0_ft_print_numbers.c
More file actions
executable file
·39 lines (31 loc) · 983 Bytes
/
0_ft_print_numbers.c
File metadata and controls
executable file
·39 lines (31 loc) · 983 Bytes
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
31
32
33
34
35
36
37
38
39
/* ***************************************************************************
* Author : Kura Peng (kpeng) <https://github.com/sayakura>
* Created : 2018/10/05
* Updated : 2018/10/05
* ***************************************************************************/
#include <unistd.h>
void ft_print_numbers(void)
{
write(1, "0123456789",10);
}
void ft_print_numbers(void)
{
int num;
num = '0';
while (num <= '9')
{
write(1, &num,1);
num++;
}
num = '\n';
write(1, &num, 1);
}
/*-------------------------------------------------------------------------------
Assignment name : ft_print_numbers
Expected files : ft_print_numbers.c
Allowed functions: write
--------------------------------------------------------------------------------
Write a function that displays all digits in ascending order.
Your function must be declared as follows:
void ft_print_numbers(void);
--------------------------------------------------------------------------------*/