ANAGRAM FOR STRING

Consider the following I/O samples. SAMPLE INPUT : abcd cdba SAMPLE OUTPUT: ANAGRAM C PROGRAM: #include<string.h> #include <stdio.h> int main() { int i,arr[26]={0}; char s1[100],s2[100]; scanf("%s %s",s1,s2); for(i=0;s1[i]!='\0';i++) arr[s1[i]-'a']++; for(i=0;s2[i]!='\0';i++) arr[s2[i]-'a']--; for(i=0;i<26;i++) { if(arr[i]!=0) { printf("Not a Anagram"); return 0; } } printf("Anagram"); } OUTPUT: The given source code in C program is short and simple to understand. The source code is well tested in DEV-C++ and is completely error free. If you have any feedback about this article ...