Monday 24 April 2017

7.Anagrams

Anagrams

Write a program to find whether the 2 given strings are anagrams or not.
Anagrams are words or phrases made by mixing up the letters of other words or phrases,

Input and Output Format:
Input consists of 2 string. Assume that all characters in the string are lowercase letters or spaces and the maximum length of the string is 100.
Refer sample input and output for formatting specifications.
All text in bold corresponds to input and the rest corresponds to output.

Sample Input and Output 1:
Enter the first string
anitha
Enter the second string
amphisoft
anitha and amphisoft are not anagrams

Sample Input and Output 2:
Enter the first string
the eyes
Enter the second string
they see
the eyes and they see are anagrams


code:

No comments:

Post a Comment