write a program in java to input a sentence and print each word in reverse order if any word contain 5 or more characters in it. Please answer to it
Answers
Answered by
1
→ We are taking a sentence as input .
→ Hence begin with "sc.nextLine()" .
→ Then we calculate the length of the string .
→ Then we run a for-loop extracting every character .
→ Concat function reverses every word.
→ The line "w=ch+w" is the critical line which helps in reversing the words .
Answered by
2
Answer:
hii good morning have a nice day ahead
Explanation:
please mark me brainliest answer
Similar questions