On this example I'll leave the code to flip a word inside a sentence (or only a word) based on the number of characters that it has.
If you run the program it will ask you to introduce a sentence or just a word:
After that, it'll ask you how many characters does the word should have to be flipped:
After entering a number (for this example 5), the program will flip the word that has 5 characters on it:



