Question: What is wrong with my program? Thanks. Your job is to find the length of the longest word in a text with no punctuation or

What is wrong with my program? Thanks. Your job is to findthe length of the longest word in a text with no punctuationWhat is wrong with my program?

Thanks.

Your job is to find the length of the longest word in a text with no punctuation or special characters of any kind - only contains words. To do so, please write a C-program that takes as a input first the number of words in a text, followed by all of the words in the text. The output of your program should be the length of the longest word in the text. To simplify your program, you can assume that the longest word will not exceed 100 characters. Examples Input: 14 This is a simple example text we have to find the largest word length Output: 7 Input: 7 All cats are grey in the dark Output: 4 Warning: You will be graded on your output, so do not include any print statements that prompt a user for input. Note You may submit as many solutions as you wish. Only your highest score will be kept. STATEMENT SOLVE HINTS Codel x + 1 #include 2 - int main(void){ 3 int number = 0; 4 int i = 0, n = 0; 5 int largest_length = 0; 6 int current_length = 0; 7 char word [100]; 8 scanf("%d", &number); 9- for(i = 0; i largest_length) { 15 largest_length = current_length; 16 } 17 18 printf("%d", largest_length); 19 return 0; 20 } Submit answer Score : 0% X Submitted on 1/3/22 7:04 PM Tests passed: 0/2 X Test #1 Wrong answer in 0 s

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!