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

Programming Exercises

Write a program to count the number of occurrences of each word in a hardcoded paragraph.

Medium

Problem Statement

Write a program to count the number of occurrences of each word in a hardcoded paragraph.

Sample Input

Paragraph: "C# is great and C# is fun"

Sample Output

Occurrences:
C#: 2
is: 2
great: 1
and: 1
fun: 1

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
using System; using System.Collections.Generic; class WordFrequency { static void Main() { // Count the occurrences of each word in the paragraph } }
Log in or sign up to run or submit your code.Log inSign up
Input
Paragraph: "C# is great and C# is fun"
Expected Output
Occurrences:
C#: 2
is: 2
great: 1
and: 1
fun: 1