42/d04/ex05/ft_sqrt.c
2016-11-20 02:20:23 +02:00

24 lines
1,015 B
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_sqrt.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gtertysh <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/10/29 17:56:37 by gtertysh #+# #+# */
/* Updated: 2016/10/29 21:53:31 by gtertysh ### ########.fr */
/* */
/* ************************************************************************** */
int ft_sqrt(int numb)
{
int i;
i = 0;
while (i * i < nb)
i++;
if (i * i == nb)
return (i);
else
return (0);
}