1. Anagram words Write a C code that asks users to enter two words, one after the other and checks if these words are anagrams (permutations of the same letters). For instance, the words “smartest”...


1.
Anagram words



Write a C code that asks users to enter two words, one after the other and checks if these words are anagrams (permutations of the same letters).



For instance, the words “smartest” and “mattress” are anagrams.



Examplea



Run 1:



Please enter first word: look

please enter the second word: cool



Sorry! “cool” and “look” are not anagrams.



Run 2:



Please enter first word: masters



please enter the second word: smartes



Yes! “masters” and “smartes” are anagrams.



Hint:


1.
If you sort the two words that are anagrams, they will become identical! For instance, “smartest” and “masters” both sort to “aemrsstt”


2.
You can use all functions in


3.
Sorting a string is exactly similar to sorting an array. You just need to know the length of the string and make sure you do not touch the terminating null.







May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here