Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Create a program to find the longest word in a sentence.

Hard

Problem 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; }
Log in or sign up to run or submit your code.Log inSign up
Input
sentence = "Write a C program to find the longest word"
Expected Output
Longest word = program