Question: in c Create a program that reads two strings of length 5 from the user. The user must enter a 5 letter word for both
Create a program that reads two strings of length 5 from the user. The user must enter a 5 letter word for both or your program should warn them and exit. Assuming the user enters valid input, your program will compare the two strings based on the following conditions: 1.If the character is the same in both strings, print a . 2. If the character is present in the first string, but not in the matching position in the second string, print a 3. If the character in the first string is not present in the second string, print nothing. Your program should include a function which accepts the following parameters: - char[l] - The string to compare against (this will be the second string as input earlier). - char - The character to compare. - int - The position of the character in the first string. The function should return a char dependent on the conditions above. Requirements - (5 points) Create a function that accepts the parameters listed above. - (2.5 points) Read in two strings of length 5 from the user using fgets. - (2.5 points) Remove the newiline character captured by the input. - (10 points) Compare the two strings and print the output as described above
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
