Hi. I'm a new member here. My instructor gave me a program to write. We have to read a string from the keyboard and display those words on the screen one word per line starting with the shortest word first. As each word is dispalyed, we have to center the word on the screen. for example, if the string is "mathew is good." then we have to display it like:-
is
good.
mathew
Now, I've already put the string into an array. I find for space(20h) and write the number of characters. Like this:- mathew6is2good.5
Now, I have to find the smallest number and write that number of character before it. I have no idea how to do it. and also i don't know how to center the word on the screen. I would really appreciate if anyone could give me a helping hand. Thank you.
is
good.
mathew
Now, I've already put the string into an array. I find for space(20h) and write the number of characters. Like this:- mathew6is2good.5
Now, I have to find the smallest number and write that number of character before it. I have no idea how to do it. and also i don't know how to center the word on the screen. I would really appreciate if anyone could give me a helping hand. Thank you.