DIR Return Create A Forum - Home
---------------------------------------------------------
Learners Tech
HTML https://learnerstech.createaforum.com
---------------------------------------------------------
*****************************************************
DIR Return to: Question Board
*****************************************************
#Post#: 29--------------------------------------------------
Question 5
DIR By: MohanKestrel
Date: July 19, 2017, 11:08 am
---------------------------------------------------------
Challenge
Using the C language, have the function LongestWord(sen) take
the sen parameter being passed and return the largest word in
the string. If there are two or more words that are the same
length, return the first word from the string with that length.
Ignore punctuation and assume sen will not be empty.
Sample Test Cases
Input:" It is a fun time"
Output:"time"
Input:"I love dogs"
Output:"love"
Hint
It might be easier to first convert the string into an array of
words, and then loop through the array searching for the word
with the most characters.
*****************************************************
Page 1 of 1