#include <stdio.h>

int	ft_strcmp(char *s1, char *s2)
{
	int	i;

	i = 0;
	while (s1[i] && s2[i] && (s1[i] == s2[i]))
		i++;
	return (s1[i] - s2[i]);
}

int main(void)
{
	char s1[] = "Hello World";
 	char s2[] = "Hello Zorld";
 	char s3[] = "Hello World";
 	int prueba_1 = ft_strcmp(s1, s3);
 	int prueba_2 = ft_strcmp(s1, s2);
 	int prueba_3 = ft_strcmp(s2, s1);
 	printf("%d\n", prueba_1);
 	printf("%d\n", prueba_2);
 	printf("%d\n", prueba_3);
}

Embed on website

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