0
can anyone make a code in which we have to type three words and the middle word is printed
for ex if we type sachin ramesh tendulkar, then ramesh will appear on the output screen
2 Réponses
+ 1
set a loop from starting to the first space and find the position of first space and then set the loop in reverse order to find position of second space.
while knowing both address set a loop to print all letters in between.
0
sure... just keep an eye on the blank spaces..
make that a loop checks character by character... after the first block of consecutive non-blank spaces u will find a blank space.. (or 2.. or more) then copy to a string the next chain of non-blank space characters...
by the way, that is the case when the user types all words separated by blank spaces.... But you can ask them to type one word at a time and save that word to each string type variable... you will only print the information on the second variable..
note: sorry about my bad English, it isn't my native language but i tried my best..