C program to check whether one string is permutation of another string


Write a program to find whether two given strings are permutations of each other.  A string str1 is a permutation of str2 if all the characters in str1 appear the same number of times in str2 and str2 is of the same length as str1.

Input: Two strings S1 and S2
Output: yes - if they satisfy given criteria
no - otherwise
Constraints:
1 <= len(S1), len(S2) <= 100.
Characters from ASCII range 0 to 127.
White space will not be given in the string.

Implementation: