Would someone help me please, it has to check if the second word is anagram to the first one.
So far ...
Code:#include <stdio.h>
void main()
{
char first[20], second[20];
int x,y;
int firstSum =0;
int secondSum =0;
printf ("enter a word: ");
gets(first);
printf ("enter an anagram: ");
gets(second);
while(first[x] !='\0')
{
firstSum += first[x];
x++;
}
while(second[y] !='\0')
{
secondSum += second[y];
y++;
}
if (firstSum==secondSum)
{
printf(" is anagarm");
}
else
{
printf(" is not an anagarm");
}
}