first commit
This commit is contained in:
25
C05/ex05/ft_sqrt.c
Normal file
25
C05/ex05/ft_sqrt.c
Normal file
@ -0,0 +1,25 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_sqrt.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: adjoly <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/07/23 22:18:51 by adjoly #+# #+# */
|
||||
/* Updated: 2023/07/25 19:41:30 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
int ft_sqrt(int nb)
|
||||
{
|
||||
int i;
|
||||
|
||||
i = 0;
|
||||
while (i <= 46340)
|
||||
{
|
||||
if (i * i == nb)
|
||||
return (i);
|
||||
i++;
|
||||
}
|
||||
return (0);
|
||||
}
|
Reference in New Issue
Block a user