Reference no: EM132194492
Part 1
Write a C language program that searches a string for the last occurrence of a specified character. When it finds the character, it should print the remainder of the string. Specifically, your program should do the following:
1. Declare a string variable (character array) that can hold up to 60 characters.
2. Initialize the string variable to the following: "Chicago was known for meat packing and gangsters."
3. Prompt the user to enter a character for which to search.
4. Use the standard function to search the string for the last occurrence of this character.
5. If the character is not found, print a message to the console.
6. If the character is found, print the remainder of the string beginning at this character.
Test your program with the character 'g' and submit a printout of your program output along with a program listing.
Part 2
Modify your program so that it prints the word containing the last occurrence the character. To stop printing after the first word, test for a space a period, or a NULL after outputting each character.