-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_sqrt.c
27 lines (25 loc) · 1.01 KB
/
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
26
27
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_sqrt.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ybouzgao <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/11/06 14:53:21 by ybouzgao #+# #+# */
/* Updated: 2017/11/06 15:11:14 by ybouzgao ### ########.fr */
/* */
/* ************************************************************************** */
int ft_sqrt(int nb)
{
int a;
int b;
a = 0;
b = 0;
while ((a * a) <= nb)
{
if ((a * a) == nb)
b = a;
a++;
}
return (b);
}