Write a program that reads a word and prints all substrings, sorted by length. For example, if

Question:

Write a program that reads a word and prints all substrings, sorted by length. For example, if the user provides the input "rum", the program prints
r
u
m
ru
um
rum

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: