// S8. Program to Count the Number of Words in a String // Program: Count the Number of Words in a String // - Words are separated by spaces. trim() removes extra spaces at the start and end. // - ...