#include <stdio.h>

int	ft_sqrt(int nb)
{
	long	i;

	i = 0;
	if (nb > 0)
	{
		while ((i * i) <= nb)
		{
			if (i > 46340)
				return (0);
			if ((i * i) == nb)
				return (i);
			i++;
		}
	}
	return (0);
}

int main (void)
{
 	printf("%d", ft_sqrt(16));
 	return (0);
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: