/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_sqrt.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: ajoly +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/07/27 21:41:03 by ajoly #+# #+# */ /* Updated: 2022/08/01 15:57:14 by ajoly ### ########.fr */ /* */ /* ************************************************************************** */ int ft_sqrt(int nb) { int i; i = 1; while (i * i < nb && i <= nb / 2) i++; if ((nb % i) == 0) return (i); return (0); } #include int main() { printf("%d", ft_sqrt(__INT_MAX__)); }