-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_sqrt.c
25 lines (23 loc) · 1014 Bytes
/
ft_sqrt.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_sqrt.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: nben-yaa <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/04/25 15:22:38 by nben-yaa #+# #+# */
/* Updated: 2018/05/08 18:09:20 by nben-yaa ### ########.fr */
/* */
/* ************************************************************************** */
int ft_sqrt(int nb)
{
int i;
i = 1;
while (i <= nb / 2)
{
if (i * i == nb)
return (i);
i++;
}
return (0);
}