- Create a string called str. The last element in the string will be a null character, \0.
- Define another string called chr of matching length, to store the characters of str:
char str[80],chr[80];
- Prompt the user to enter a string. The entered string will be assigned to the str string:
printf("Enter a string: ");scanf("%s",str);
- Compute the length of the string array, str, using strlen:
n=strlen(str);
- Define an integer array called count to display the number of times the characters have occurred in str:
int count[80];
- Execute chr[0]=str[0] to assign the first character of str to chr at index location chr[0].
- The count of the character that's assigned in the chr[0] location is represented by assigning 1 at the count[0] ...