-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_min.c
29 lines (26 loc) · 1.05 KB
/
ft_min.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_min.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: thifranc <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/03/12 10:43:03 by thifranc #+# #+# */
/* Updated: 2016/03/12 10:44:20 by thifranc ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_min(int *tab, int size)
{
int min;
int i;
i = 1;
min = tab[0];
while (i < size)
{
if (min > tab[i])
min = tab[i];
i++;
}
return (min);
}