Wednesday, November 7, 2012

Java Exercise #46: Anagram

The problem is to write a method that checks whether two strings are Anagrams.

Two words are anagrams if they contain the same letters in any order. For example, "silent" and "listen" are anagrams.

Exercise: Write a program that prompts the user to enter two strings and verify whether they are anagrams


Enter the first String: garden
Enter the second String: ranged
garden and ranged are anagrams


Enter the first String: gardens
Enter the second String: dangers
gardens and dangers are anagrams


Download Code: Anagrams

No comments:

Post a Comment