Fix Is_Anagram
Created on June 16, 2024 by Julien Palard
I wrote a function, called is_anagram, but it does not work, can you fix it?
To test your code I'll provide my own main function, you don't need
to implement it. For the curious, my test function looks like:
#include <stdlib.h>
#include <stdio.h>
int is_anagram(const char *left, const char *right);
int main(int ac, char **av){
if (ac < 3) {
fprintf(stderr, "Usage: %s left_string right_string\n", av[0]);
return EXIT_FAILURE;
}
if (is_anagram(av[1], av[2]) == 0) {
printf("They are anagrams!\n");
} else {
printf("They are not anagrams!\n");
}
return EXIT_SUCCESS;
}
To compile your code with my main I'll use:
cc my_main.c your_code.c -o is_anagram
Then I'll test it like;
./is_anagram abc bac
There's no corrections yet, hit the `Submit` button to send your code to the correction bot.
Keyboard shortcuts:
- Ctrl-Enter: Send your code to the correction bot.
- Escape: Get back to the instructions tab.