Write a C Program that has the following functions: Function 1: Asks the user to enter an unknown number of characters (until hits Enter) and store it in an array of characters. The number of characters will never be more than 100. Assume all characters entered are lowercase (small letters: i.e. a, b, c, etc… ). Function 2: The function should swap the first character with the last character in the array using pointers. Function 3: Count the frequency (تكرار) of the first 10 letters of the alphabet in the array (from a to j). That is, it should count how many times the letter ‘a’ was in the array, how many times the letter ‘b’ was in the array, etc.. The frequencies should be stored in another array of size 10. Function 4:Receive the frequencies of the previous function and print them to screen. For example, if the user enters: establishment The program should print to screen: a: 1, b: 1, c: 0, d: 0, e: 2, f: 0, g: 0, h: 1, i: 1, j: 0.
Write a C
Function 1: Asks the user to enter an unknown number of characters (until hits Enter) and store it in an array of characters. The number of characters will never be more than 100. Assume all characters entered are lowercase (small letters: i.e. a, b, c, etc… ).
Function 2: The function should swap the first character with the last character in the array using pointers.
Function 3: Count the frequency (تكرار) of the first 10 letters of the alphabet in the array (from a to j). That is, it should count how many times the letter ‘a’ was in the array, how many times the letter ‘b’ was in the array, etc.. The frequencies should be stored in another array of size 10.
Function 4:Receive the frequencies of the previous function and print them to screen.
For example, if the user enters: establishment
The program should print to screen:
a: 1, b: 1, c: 0, d: 0, e: 2, f: 0, g: 0, h: 1, i: 1, j: 0.
Step by step
Solved in 2 steps