Create a program to find the longest word in a sentence.
HardProblem Statement
Create a program to find the longest word in a sentence.
Sample Input
sentence = "Write a C program to find the longest word"
Sample Output
Longest word = program
Limits
Time: 2s · Memory: 256 MB
Code Editor
00:00
#include <stdio.h>
#include <string.h>
int main() {
char sentence[] = "Write a C program to find the longest word";
// Logic to find the longest word
return 0;
}
Input
sentence = "Write a C program to find the longest word"
Expected Output
Longest word = program