CODEBHAVYA • C PRACTICE ARENA

✍️ 24. C Practice Arena

Move from beginner C programming to placement-level problem solving through 12 progressive levels. Each challenge uses an original CodeBhavya story presentation while preserving the intended C concept and programming skill.

12Progressive Levels
240Total Challenges
217Online Judge Challenges
23Local File Labs
Online Judge Progress0%
0 / 217Solved
0Completed with Solution
0 / 10400Weighted Online Score
10–100Difficulty-Based Points
⚖️ Difficulty-Based Scoring: Starter challenges carry fewer points, while advanced and placement challenges carry more. Using a hint keeps up to 90% of the challenge points; viewing the full program makes it a non-competitive completion.
CHOOSE YOUR PATH

🎯 Choose Your Practice Level

Start with Level 1 and move step by step, or jump directly to the topic you want to practice.

Beginner Practice

Build confidence with fundamentals, decisions, loops and pattern logic.

Intermediate Practice

Strengthen arrays, strings, functions, recursion, pointers and memory.

Advanced Practice

Work with records, files, dynamic memory, terminal input and bitwise programming.

Placement Practice

Finish with interview-style coding challenges and algorithmic problem solving.

STORY-BASED CHALLENGES

🧩 Open a Level & Start Solving

Challenge cards stay compact until you open them. Each opened challenge shows the story, task, input/output contract, constraints, example, concepts and the appropriate practice mode.

🌱Level 1 — C FoundationsOutput, input, arithmetic and everyday calculations. • 20 original CodeBhavya challenges
Open 20 Challenges

Every challenge keeps the original C-learning objective from this level, while the story, framing and presentation are newly written for CodeBhavya.

CHALLENGE 01Starter

Orientation Welcome Screen

Core Skill: Hello World

C BasicsOnline Judge10 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Orientation Welcome Screen

During a beginner lab session, the Orientation Welcome Screen needs a tiny C utility. Build the program so it can print:.

🎯 Your Task

Print:.

📥 Input Format

No runtime input is required for this challenge.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use beginner-friendly values within normal C numeric ranges.

Example Input
No input
Example Output
Hello World
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
C BasicsStarter10 Points
CHALLENGE 02Starter

Student Badge Printer

Core Skill: Print Your Name

C BasicsOnline Judge10 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Student Badge Printer

During a beginner lab session, the Student Badge Printer needs a tiny C utility. Build the program so it can produce your name.

🎯 Your Task

Produce your name.

📥 Input Format

No runtime input is required for this challenge.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use beginner-friendly values within normal C numeric ranges.

Example Input
No input
Example Output
Venu
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
C BasicsStarter10 Points
CHALLENGE 03Basic

Token Number Kiosk

Core Skill: Read and Print an Integer

C BasicsOnline Judge20 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Token Number Kiosk

During a beginner lab session, the Token Number Kiosk needs a tiny C utility. Build the program so it can accept an integer from the user and print it.

🎯 Your Task

Accept an integer from the user and print it.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use beginner-friendly values within normal C numeric ranges.

Example Input
25
Example Output
25
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
C BasicsBasic20 Points
CHALLENGE 04Basic

Canteen Total Counter

Core Skill: Add Two Numbers

C BasicsOnline Judge20 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Canteen Total Counter

During a beginner lab session, the Canteen Total Counter needs a tiny C utility. Build the program so it can determine the sum of two integers.

🎯 Your Task

Determine the sum of two integers.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use beginner-friendly values within normal C numeric ranges.

Example Input
10 20
Example Output
30
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
C BasicsBasic20 Points
CHALLENGE 05Basic

Workshop Expense Desk

Core Skill: Subtract Two Numbers

C BasicsOnline Judge20 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Workshop Expense Desk

During a beginner lab session, the Workshop Expense Desk needs a tiny C utility. Build the program so it can determine the difference between two integers.

🎯 Your Task

Determine the difference between two integers.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use beginner-friendly values within normal C numeric ranges.

Example Input
20 8
Example Output
12
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
C BasicsBasic20 Points
CHALLENGE 06Basic

Bookstall Quantity Meter

Core Skill: Multiply Two Numbers

C BasicsOnline Judge20 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Bookstall Quantity Meter

During a beginner lab session, the Bookstall Quantity Meter needs a tiny C utility. Build the program so it can determine the product of two integers.

🎯 Your Task

Determine the product of two integers.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use beginner-friendly values within normal C numeric ranges.

Example Input
5 6
Example Output
30
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
C BasicsBasic20 Points
CHALLENGE 07Basic

Cafeteria Sharing Board

Core Skill: Divide Two Numbers

C BasicsOnline Judge20 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Cafeteria Sharing Board

During a beginner lab session, the Cafeteria Sharing Board needs a tiny C utility. Build the program so it can determine the integer quotient of two numbers.

🎯 Your Task

Determine the integer quotient of two numbers.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use beginner-friendly values within normal C numeric ranges.

Example Input
20 4
Example Output
5
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
C BasicsBasic20 Points
CHALLENGE 08Easy

Lab Kit Packing Desk

Core Skill: Quotient and Remainder

C BasicsOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Lab Kit Packing Desk

During a beginner lab session, the Lab Kit Packing Desk needs a tiny C utility. Build the program so it can determine quotient and remainder when one number is divided by another.

🎯 Your Task

Determine quotient and remainder when one number is divided by another.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use beginner-friendly values within normal C numeric ranges.

Example Input
17 5
Example Output
Quotient = 3
Remainder = 2
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
C BasicsEasy30 Points
CHALLENGE 09Easy

Three-Test Score Board

Core Skill: Average of Three Numbers

C BasicsOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Three-Test Score Board

During a beginner lab session, the Three-Test Score Board needs a tiny C utility. Build the program so it can determine the average of three numbers.

🎯 Your Task

Determine the average of three numbers.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use beginner-friendly values within normal C numeric ranges.

Example Input
10 20 30
Example Output
20.00
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
C BasicsEasy30 Points
CHALLENGE 10Basic

Garden Circular Bed Planner

Core Skill: Area of a Circle

C BasicsOnline Judge20 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Garden Circular Bed Planner

During a beginner lab session, the Garden Circular Bed Planner needs a tiny C utility. Build the program so it can compute the area of a circle.

🎯 Your Task

Compute the area of a circle.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use beginner-friendly values within normal C numeric ranges.

Example Input
5
Example Output
78.50
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
C BasicsBasic20 Points
CHALLENGE 11Basic

Classroom Floor Planner

Core Skill: Area of a Rectangle

C BasicsOnline Judge20 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Classroom Floor Planner

During a beginner lab session, the Classroom Floor Planner needs a tiny C utility. Build the program so it can compute the area of a rectangle.

🎯 Your Task

Compute the area of a rectangle.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use beginner-friendly values within normal C numeric ranges.

Example Input
10 5
Example Output
50
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
C BasicsBasic20 Points
CHALLENGE 12Easy

Student Loan Demo

Core Skill: Simple Interest

C BasicsOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Student Loan Demo

During a beginner lab session, the Student Loan Demo needs a tiny C utility. Build the program so it can compute simple interest using:.

🎯 Your Task

Compute simple interest using:.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use beginner-friendly values within normal C numeric ranges.

Example Input
10000 5 2
Example Output
1000.00
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
C BasicsEasy30 Points
CHALLENGE 13Basic

Weather Desk Converter

Core Skill: Celsius to Fahrenheit

C BasicsOnline Judge20 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Weather Desk Converter

During a beginner lab session, the Weather Desk Converter needs a tiny C utility. Build the program so it can convert Celsius to Fahrenheit.

🎯 Your Task

Convert celsius to fahrenheit.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use beginner-friendly values within normal C numeric ranges.

Example Input
25
Example Output
77.00
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
C BasicsBasic20 Points
CHALLENGE 14Basic

Exchange Student Weather Desk

Core Skill: Fahrenheit to Celsius

C BasicsOnline Judge20 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Exchange Student Weather Desk

During a beginner lab session, the Exchange Student Weather Desk needs a tiny C utility. Build the program so it can convert Fahrenheit to Celsius.

🎯 Your Task

Convert fahrenheit to celsius.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use beginner-friendly values within normal C numeric ranges.

Example Input
77
Example Output
25.00
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
C BasicsBasic20 Points
CHALLENGE 15Easy

Sports Bib Swap Desk

Core Skill: Swap Using Third Variable

C BasicsOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Sports Bib Swap Desk

During a beginner lab session, the Sports Bib Swap Desk needs a tiny C utility. Build the program so it can swap two integers using a third variable.

🎯 Your Task

Swap two integers using a third variable.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use beginner-friendly values within normal C numeric ranges.

Example Input
10 20
Example Output
20 10
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
C BasicsEasy30 Points
CHALLENGE 16Easy+

Locker Number Swap Panel

Core Skill: Swap Without Third Variable

C BasicsOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Locker Number Swap Panel

During a beginner lab session, the Locker Number Swap Panel needs a tiny C utility. Build the program so it can swap two integers without using a third variable.

🎯 Your Task

Swap two integers without using a third variable.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use beginner-friendly values within normal C numeric ranges.

Example Input
10 20
Example Output
20 10
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
C BasicsEasy+40 Points
CHALLENGE 17Basic

Geometry Practice Console

Core Skill: Square and Cube

C BasicsOnline Judge20 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Geometry Practice Console

During a beginner lab session, the Geometry Practice Console needs a tiny C utility. Build the program so it can determine the square and cube of a number.

🎯 Your Task

Determine the square and cube of a number.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use beginner-friendly values within normal C numeric ranges.

Example Input
5
Example Output
Square = 25
Cube = 125
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
C BasicsBasic20 Points
CHALLENGE 18Easy

Event Timer Converter

Core Skill: Convert Seconds

C BasicsOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Event Timer Converter

During a beginner lab session, the Event Timer Converter needs a tiny C utility. Build the program so it can convert seconds into hours, minutes and seconds.

🎯 Your Task

Convert seconds into hours, minutes and seconds.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use beginner-friendly values within normal C numeric ranges.

Example Input
3665
Example Output
Hours = 1
Minutes = 1
Seconds = 5
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
C BasicsEasy30 Points
CHALLENGE 19Easy

Assessment Summary Desk

Core Skill: Total and Percentage

C BasicsOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Assessment Summary Desk

During a beginner lab session, the Assessment Summary Desk needs a tiny C utility. Build the program so it can accept marks of five subjects and calculate total and percentage.

🎯 Your Task

Accept marks of five subjects and calculate total and percentage.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use beginner-friendly values within normal C numeric ranges.

Example Input
80 75 90 85 70
Example Output
Total = 400
Percentage = 80.00
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
C BasicsEasy30 Points
CHALLENGE 20Easy+

Campus Mini Calculator

Core Skill: Simple Calculator

C BasicsOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Campus Mini Calculator

During a beginner lab session, the Campus Mini Calculator needs a tiny C utility. Build the program so it can perform addition, subtraction, multiplication and division.

🎯 Your Task

Perform addition, subtraction, multiplication and division.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use beginner-friendly values within normal C numeric ranges.

Example Input
10 + 5
Example Output
15.00
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
C BasicsEasy+40 Points
🔀Level 2 — Operators & DecisionsConditions, comparisons, decisions and switch-based logic. • 20 original CodeBhavya challenges
Open 20 Challenges

Every challenge keeps the original C-learning objective from this level, while the story, framing and presentation are newly written for CodeBhavya.

CHALLENGE 01Basic

Temperature Safety Gate

Core Skill: Positive, Negative or Zero

Decision MakingOnline Judge20 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Temperature Safety Gate

The Temperature Safety Gate receives a value and must make the correct decision. Use C conditions so it can determine whether a number is positive, negative or zero.

🎯 Your Task

Determine whether a number is positive, negative or zero.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use values within ordinary C integer ranges; marks/percentages use their natural limits.

Example Input
-8
Example Output
Negative
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Decision MakingBasic20 Points
CHALLENGE 02Basic

Odd-Even Token Scanner

Core Skill: Even or Odd

Decision MakingOnline Judge20 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Odd-Even Token Scanner

The Odd-Even Token Scanner receives a value and must make the correct decision. Use C conditions so it can determine whether an integer is even or odd.

🎯 Your Task

Determine whether an integer is even or odd.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use values within ordinary C integer ranges; marks/percentages use their natural limits.

Example Input
24
Example Output
Even
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Decision MakingBasic20 Points
CHALLENGE 03Basic

Scholarship Comparison Desk

Core Skill: Greater of Two Numbers

Decision MakingOnline Judge20 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Scholarship Comparison Desk

The Scholarship Comparison Desk receives a value and must make the correct decision. Use C conditions so it can determine the greater of two numbers.

🎯 Your Task

Determine the greater of two numbers.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use values within ordinary C integer ranges; marks/percentages use their natural limits.

Example Input
25 18
Example Output
25
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Decision MakingBasic20 Points
CHALLENGE 04Easy

Top Score Selector

Core Skill: Greatest of Three Numbers

Decision MakingOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Top Score Selector

The Top Score Selector receives a value and must make the correct decision. Use C conditions so it can determine the greatest among three integers.

🎯 Your Task

Determine the greatest among three integers.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use values within ordinary C integer ranges; marks/percentages use their natural limits.

Example Input
10 35 20
Example Output
35
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Decision MakingEasy30 Points
CHALLENGE 05Basic

Canteen Coupon Validator

Core Skill: Divisible by 5

Decision MakingOnline Judge20 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Canteen Coupon Validator

The Canteen Coupon Validator receives a value and must make the correct decision. Use C conditions so it can determine whether a number is divisible by 5.

🎯 Your Task

Determine whether a number is divisible by 5.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use values within ordinary C integer ranges; marks/percentages use their natural limits.

Example Input
45
Example Output
Divisible by 5
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Decision MakingBasic20 Points
CHALLENGE 06Easy

Dual-Rule Entry Gate

Core Skill: Divisible by Both 3 and 5

Decision MakingOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Dual-Rule Entry Gate

The Dual-Rule Entry Gate receives a value and must make the correct decision. Use C conditions so it can determine whether a number is divisible by both 3 and 5.

🎯 Your Task

Determine whether a number is divisible by both 3 and 5.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use values within ordinary C integer ranges; marks/percentages use their natural limits.

Example Input
30
Example Output
Divisible by both 3 and 5
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Decision MakingEasy30 Points
CHALLENGE 07Easy+

Academic Calendar Checker

Core Skill: Leap Year

Decision MakingOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Academic Calendar Checker

The Academic Calendar Checker receives a value and must make the correct decision. Use C conditions so it can determine whether a given year is a leap year.

🎯 Your Task

Determine whether a given year is a leap year.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use values within ordinary C integer ranges; marks/percentages use their natural limits.

Example Input
2024
Example Output
Leap Year
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Decision MakingEasy+40 Points
CHALLENGE 08Basic

Language Lab Character Gate

Core Skill: Vowel or Consonant

Decision MakingOnline Judge20 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Language Lab Character Gate

The Language Lab Character Gate receives a value and must make the correct decision. Use C conditions so it can determine whether a character is a vowel or consonant.

🎯 Your Task

Determine whether a character is a vowel or consonant.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use values within ordinary C integer ranges; marks/percentages use their natural limits.

Example Input
e
Example Output
Vowel
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Decision MakingBasic20 Points
CHALLENGE 09Easy

Keyboard Input Classifier

Core Skill: Alphabet, Digit or Special Character

Decision MakingOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Keyboard Input Classifier

The Keyboard Input Classifier receives a value and must make the correct decision. Use C conditions so it can determine whether a character is an alphabet, digit or special character.

🎯 Your Task

Determine whether a character is an alphabet, digit or special character.

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use values within ordinary C integer ranges; marks/percentages use their natural limits.

Example Input
7
Example Output
Digit
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Decision MakingEasy30 Points
CHALLENGE 10Basic

Election Eligibility Booth

Core Skill: Eligible to Vote

Decision MakingOnline Judge20 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Election Eligibility Booth

The Election Eligibility Booth receives a value and must make the correct decision. Use C conditions so it can determine whether a person is eligible to vote.

🎯 Your Task

Determine whether a person is eligible to vote.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use values within ordinary C integer ranges; marks/percentages use their natural limits.

Example Input
20
Example Output
Eligible to Vote
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Decision MakingBasic20 Points
CHALLENGE 11Basic

Distance Error Corrector

Core Skill: Absolute Value

Decision MakingOnline Judge20 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Distance Error Corrector

The Distance Error Corrector receives a value and must make the correct decision. Use C conditions so it can determine the absolute value without using abs() .

🎯 Your Task

Determine the absolute value without using abs() .

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use values within ordinary C integer ranges; marks/percentages use their natural limits.

Example Input
-25
Example Output
25
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Decision MakingBasic20 Points
CHALLENGE 12Easy

Two-Offer Selector

Core Skill: Largest Using Conditional Operator

ComparisonOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Two-Offer Selector

The Two-Offer Selector receives a value and must make the correct decision. Use C conditions so it can determine the largest of two numbers using the conditional operator.

🎯 Your Task

Determine the largest of two numbers using the conditional operator.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use values within ordinary C integer ranges; marks/percentages use their natural limits.

Example Input
40 25
Example Output
40
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ComparisonEasy30 Points
CHALLENGE 13Easy

Minimum Resource Selector

Core Skill: Smallest Using Conditional Operator

ComparisonOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Minimum Resource Selector

The Minimum Resource Selector receives a value and must make the correct decision. Use C conditions so it can determine the smallest of two numbers using the conditional operator.

🎯 Your Task

Determine the smallest of two numbers using the conditional operator.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use values within ordinary C integer ranges; marks/percentages use their natural limits.

Example Input
40 25
Example Output
25
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ComparisonEasy30 Points
CHALLENGE 14Easy+

Grade Dispatch System

Core Skill: Student Grade

Decision MakingOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Grade Dispatch System

The Grade Dispatch System receives a value and must make the correct decision. Use C conditions so it can accept marks and print the grade.

🎯 Your Task

Accept marks and print the grade.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use values within ordinary C integer ranges; marks/percentages use their natural limits.

Example Input
85
Example Output
Grade B
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Decision MakingEasy+40 Points
CHALLENGE 15Easy

Campus Store Margin Desk

Core Skill: Profit or Loss

Decision MakingOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Campus Store Margin Desk

The Campus Store Margin Desk receives a value and must make the correct decision. Use C conditions so it can determine profit or loss using cost price and selling price.

🎯 Your Task

Determine profit or loss using cost price and selling price.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use values within ordinary C integer ranges; marks/percentages use their natural limits.

Example Input
500 650
Example Output
Profit = 150
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Decision MakingEasy30 Points
CHALLENGE 16Easy

Festival Discount Counter

Core Skill: Discount Calculator

Decision MakingOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Festival Discount Counter

The Festival Discount Counter receives a value and must make the correct decision. Use C conditions so it can compute the final price after discount.

🎯 Your Task

Compute the final price after discount.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use values within ordinary C integer ranges; marks/percentages use their natural limits.

Example Input
1000 10
Example Output
Final Price = 900.00
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Decision MakingEasy30 Points
CHALLENGE 17Easy+

Hostel Energy Billing Desk

Core Skill: Electricity Bill

Decision MakingOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Hostel Energy Billing Desk

The Hostel Energy Billing Desk receives a value and must make the correct decision. Use C conditions so it can compute electricity bill based on units.

🎯 Your Task

Compute electricity bill based on units.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use values within ordinary C integer ranges; marks/percentages use their natural limits.

Example Input
250
Example Output
Bill = 500.00
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Decision MakingEasy+40 Points
CHALLENGE 18Easy

Construction Triangle Validator

Core Skill: Valid Triangle

Decision MakingOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Construction Triangle Validator

The Construction Triangle Validator receives a value and must make the correct decision. Use C conditions so it can determine whether three sides form a valid triangle.

🎯 Your Task

Determine whether three sides form a valid triangle.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use values within ordinary C integer ranges; marks/percentages use their natural limits.

Example Input
3 4 5
Example Output
Valid Triangle
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Decision MakingEasy30 Points
CHALLENGE 19Easy+

Triangle Signboard Classifier

Core Skill: Type of Triangle

Decision MakingOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Triangle Signboard Classifier

The Triangle Signboard Classifier receives a value and must make the correct decision. Use C conditions so it can determine whether a triangle is Equilateral, Isosceles or Scalene.

🎯 Your Task

Determine whether a triangle is equilateral, isosceles or scalene.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use values within ordinary C integer ranges; marks/percentages use their natural limits.

Example Input
5 5 3
Example Output
Isosceles Triangle
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Decision MakingEasy+40 Points
CHALLENGE 20Easy+

Service Counter Calculator

Core Skill: Simple Calculator Using switch

Decision MakingOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Service Counter Calculator

The Service Counter Calculator receives a value and must make the correct decision. Use C conditions so it can perform addition, subtraction, multiplication and division using switch .

🎯 Your Task

Perform addition, subtraction, multiplication and division using switch .

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use values within ordinary C integer ranges; marks/percentages use their natural limits.

Example Input
20 * 5
Example Output
100.00
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Decision MakingEasy+40 Points
🔁Level 3 — Loops & Number LogicIteration, digit logic, prime numbers, Fibonacci and factorial. • 20 original CodeBhavya challenges
Open 20 Challenges

Every challenge keeps the original C-learning objective from this level, while the story, framing and presentation are newly written for CodeBhavya.

CHALLENGE 01Basic

Morning Roll-Call Counter

Core Skill: Print Numbers from 1 to N

LoopsOnline Judge20 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Morning Roll-Call Counter

The Morning Roll-Call Counter processes repeated numeric steps. Use loop-driven C logic to produce all numbers from 1 to N .

🎯 Your Task

Produce all numbers from 1 to n .

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use positive inputs small enough for the requested loop/number operation.

Example Input
5
Example Output
1 2 3 4 5
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
LoopsBasic20 Points
CHALLENGE 02Basic

Closing Countdown Board

Core Skill: Print Numbers from N to 1

LoopsOnline Judge20 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Closing Countdown Board

The Closing Countdown Board processes repeated numeric steps. Use loop-driven C logic to produce numbers from N to 1 .

🎯 Your Task

Produce numbers from n to 1 .

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use positive inputs small enough for the requested loop/number operation.

Example Input
5
Example Output
5 4 3 2 1
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
LoopsBasic20 Points
CHALLENGE 03Basic

Even Seat Number Display

Core Skill: Print Even Numbers from 1 to N

LoopsOnline Judge20 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Even Seat Number Display

The Even Seat Number Display processes repeated numeric steps. Use loop-driven C logic to produce all even numbers between 1 and N.

🎯 Your Task

Produce all even numbers between 1 and n.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use positive inputs small enough for the requested loop/number operation.

Example Input
10
Example Output
2 4 6 8 10
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
LoopsBasic20 Points
CHALLENGE 04Basic

Odd Locker Number Display

Core Skill: Print Odd Numbers from 1 to N

LoopsOnline Judge20 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Odd Locker Number Display

The Odd Locker Number Display processes repeated numeric steps. Use loop-driven C logic to produce all odd numbers between 1 and N.

🎯 Your Task

Produce all odd numbers between 1 and n.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use positive inputs small enough for the requested loop/number operation.

Example Input
10
Example Output
1 3 5 7 9
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
LoopsBasic20 Points
CHALLENGE 05Easy

Donation Total Tracker

Core Skill: Sum of Numbers from 1 to N

LoopsOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Donation Total Tracker

The Donation Total Tracker processes repeated numeric steps. Use loop-driven C logic to determine the sum of all numbers from 1 to N.

🎯 Your Task

Determine the sum of all numbers from 1 to n.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use positive inputs small enough for the requested loop/number operation.

Example Input
5
Example Output
15
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
LoopsEasy30 Points
CHALLENGE 06Easy

Even Coupon Total

Core Skill: Sum of Even Numbers from 1 to N

LoopsOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Even Coupon Total

The Even Coupon Total processes repeated numeric steps. Use loop-driven C logic to determine the sum of all even numbers between 1 and N.

🎯 Your Task

Determine the sum of all even numbers between 1 and n.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use positive inputs small enough for the requested loop/number operation.

Example Input
10
Example Output
30
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
LoopsEasy30 Points
CHALLENGE 07Easy

Odd Ticket Total

Core Skill: Sum of Odd Numbers from 1 to N

LoopsOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Odd Ticket Total

The Odd Ticket Total processes repeated numeric steps. Use loop-driven C logic to determine the sum of all odd numbers between 1 and N.

🎯 Your Task

Determine the sum of all odd numbers between 1 and n.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use positive inputs small enough for the requested loop/number operation.

Example Input
10
Example Output
25
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
LoopsEasy30 Points
CHALLENGE 08Basic

Multiplication Practice Wall

Core Skill: Multiplication Table

LoopsOnline Judge20 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Multiplication Practice Wall

The Multiplication Practice Wall processes repeated numeric steps. Use loop-driven C logic to produce the multiplication table of a given number up to 10.

🎯 Your Task

Produce the multiplication table of a given number up to 10.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use positive inputs small enough for the requested loop/number operation.

Example Input
5
Example Output
5 x 1 = 5
5 x 2 = 10
5 x 3 = 15
5 x 4 = 20
5 x 5 = 25
5 x 6 = 30
5 x 7 = 35
5 x 8 = 40
5 x 9 = 45
5 x 10 = 50
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
LoopsBasic20 Points
CHALLENGE 09Easy

Library Code Digit Counter

Core Skill: Count Digits of a Number

LoopsOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Library Code Digit Counter

The Library Code Digit Counter processes repeated numeric steps. Use loop-driven C logic to count the number of digits in an integer.

🎯 Your Task

Count the number of digits in an integer.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use positive inputs small enough for the requested loop/number operation.

Example Input
12345
Example Output
5
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
LoopsEasy30 Points
CHALLENGE 10Easy

Digital Wallet Digit Sum

Core Skill: Sum of Digits

LoopsOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Digital Wallet Digit Sum

The Digital Wallet Digit Sum processes repeated numeric steps. Use loop-driven C logic to determine the sum of all digits of a number.

🎯 Your Task

Determine the sum of all digits of a number.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use positive inputs small enough for the requested loop/number operation.

Example Input
12345
Example Output
15
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
LoopsEasy30 Points
CHALLENGE 11Easy+

Badge Number Reversal Desk

Core Skill: Reverse a Number

LoopsOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Badge Number Reversal Desk

The Badge Number Reversal Desk processes repeated numeric steps. Use loop-driven C logic to reverse the digits of a given number.

🎯 Your Task

Reverse the digits of a given number.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use positive inputs small enough for the requested loop/number operation.

Example Input
12345
Example Output
54321
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
LoopsEasy+40 Points
CHALLENGE 12Easy+

Mirror Badge Validator

Core Skill: Palindrome Number

PalindromeOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Mirror Badge Validator

The Mirror Badge Validator processes repeated numeric steps. Use loop-driven C logic to determine whether a number is a palindrome.

🎯 Your Task

Determine whether a number is a palindrome.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use positive inputs small enough for the requested loop/number operation.

Example Input
121
Example Output
Palindrome
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
PalindromeEasy+40 Points
CHALLENGE 13Easy

Secure Code Digit Product

Core Skill: Product of Digits

LoopsOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Secure Code Digit Product

The Secure Code Digit Product processes repeated numeric steps. Use loop-driven C logic to determine the product of all digits of a number.

🎯 Your Task

Determine the product of all digits of a number.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use positive inputs small enough for the requested loop/number operation.

Example Input
1234
Example Output
24
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
LoopsEasy30 Points
CHALLENGE 14Easy

Gate Pass Edge Digits

Core Skill: First and Last Digit

LoopsOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Gate Pass Edge Digits

The Gate Pass Edge Digits processes repeated numeric steps. Use loop-driven C logic to determine the first and last digit of a number.

🎯 Your Task

Determine the first and last digit of a number.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use positive inputs small enough for the requested loop/number operation.

Example Input
12345
Example Output
First = 1
Last = 5
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
LoopsEasy30 Points
CHALLENGE 15Easy+

Device Code Parity Counter

Core Skill: Count Even and Odd Digits

LoopsOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Device Code Parity Counter

The Device Code Parity Counter processes repeated numeric steps. Use loop-driven C logic to count the number of even and odd digits in a given number.

🎯 Your Task

Count the number of even and odd digits in a given number.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use positive inputs small enough for the requested loop/number operation.

Example Input
123456
Example Output
Even Digits = 3
Odd Digits = 3
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
LoopsEasy+40 Points
CHALLENGE 16Moderate

Museum Cube-Code Check

Core Skill: Armstrong Number

LoopsOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Museum Cube-Code Check

The Museum Cube-Code Check processes repeated numeric steps. Use loop-driven C logic to determine whether a three-digit number is an Armstrong number.

🎯 Your Task

Determine whether a three-digit number is an armstrong number.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use positive inputs small enough for the requested loop/number operation.

Example Input
153
Example Output
Armstrong Number
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
LoopsModerate50 Points
CHALLENGE 17Moderate

Prime Access Code

Core Skill: Prime Number

Number TheoryOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Prime Access Code

The Prime Access Code processes repeated numeric steps. Use loop-driven C logic to determine whether a given number is prime.

🎯 Your Task

Determine whether a given number is prime.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use positive inputs small enough for the requested loop/number operation.

Example Input
29
Example Output
Prime Number
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Number TheoryModerate50 Points
CHALLENGE 18Intermediate

Prime Range Scanner

Core Skill: Prime Numbers in a Range

Number TheoryOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Prime Range Scanner

The Prime Range Scanner processes repeated numeric steps. Use loop-driven C logic to produce all prime numbers between two given numbers.

🎯 Your Task

Produce all prime numbers between two given numbers.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use positive inputs small enough for the requested loop/number operation.

Example Input
10 30
Example Output
11 13 17 19 23 29
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Number TheoryIntermediate60 Points
CHALLENGE 19Moderate

Robotics Sequence Generator

Core Skill: Fibonacci Series

LoopsOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Robotics Sequence Generator

The Robotics Sequence Generator processes repeated numeric steps. Use loop-driven C logic to produce the first N terms of the Fibonacci series.

🎯 Your Task

Produce the first n terms of the fibonacci series.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use positive inputs small enough for the requested loop/number operation.

Example Input
8
Example Output
0 1 1 2 3 5 8 13
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
LoopsModerate50 Points
CHALLENGE 20Easy+

Workshop Arrangement Counter

Core Skill: Factorial of a Number

LoopsOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Workshop Arrangement Counter

The Workshop Arrangement Counter processes repeated numeric steps. Use loop-driven C logic to determine the factorial of a given number.

🎯 Your Task

Determine the factorial of a given number.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use positive inputs small enough for the requested loop/number operation.

Example Input
5
Example Output
120
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
LoopsEasy+40 Points
Level 4 — Pattern StudioNested loops through visual star, number and alphabet patterns. • 20 original CodeBhavya challenges
Open 20 Challenges

Every challenge keeps the original C-learning objective from this level, while the story, framing and presentation are newly written for CodeBhavya.

CHALLENGE 01Easy

Square Stage Light Wall

Core Skill: Square Star Pattern

Nested LoopsOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Square Stage Light Wall

The Square Stage Light Wall controls a row-by-row TechFest display. Use nested loops to produce a square pattern of stars with N rows and N columns.

🎯 Your Task

Produce a square pattern of stars with n rows and n columns.

📥 Input Format

Read one positive integer N that controls the number of rows in the pattern.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 20

Example Input
4
Example Output
* * * * 
* * * * 
* * * * 
* * * *
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Nested LoopsEasy30 Points
CHALLENGE 02Easy

Rectangular Welcome Banner

Core Skill: Rectangle Star Pattern

Nested LoopsOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Rectangular Welcome Banner

The Rectangular Welcome Banner controls a row-by-row TechFest display. Use nested loops to produce a rectangle with R rows and C columns.

🎯 Your Task

Produce a rectangle with r rows and c columns.

📥 Input Format

Read one positive integer N that controls the number of rows in the pattern.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 20

Example Input
3 5
Example Output
* * * * * 
* * * * * 
* * * * *
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Nested LoopsEasy30 Points
CHALLENGE 03Easy

Right-Wing Light Ramp

Core Skill: Right Triangle Star Pattern

Nested LoopsOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Right-Wing Light Ramp

The Right-Wing Light Ramp controls a row-by-row TechFest display. Use nested loops to produce a right triangle using stars.

🎯 Your Task

Produce a right triangle using stars.

📥 Input Format

Read one positive integer N that controls the number of rows in the pattern.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 20

Example Input
5
Example Output
* 
* * 
* * * 
* * * * 
* * * * *
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Nested LoopsEasy30 Points
CHALLENGE 04Easy

Closing Light Ramp

Core Skill: Inverted Right Triangle

Nested LoopsOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Closing Light Ramp

The Closing Light Ramp controls a row-by-row TechFest display. Use nested loops to produce an inverted right triangle using stars.

🎯 Your Task

Produce an inverted right triangle using stars.

📥 Input Format

Read one positive integer N that controls the number of rows in the pattern.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 20

Example Input
5
Example Output
* * * * * 
* * * * 
* * * 
* * 
*
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Nested LoopsEasy30 Points
CHALLENGE 05Easy+

Left-Wing Light Ramp

Core Skill: Left-Aligned Triangle

Nested LoopsOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Left-Wing Light Ramp

The Left-Wing Light Ramp controls a row-by-row TechFest display. Use nested loops to produce a left-aligned triangle with spaces and stars.

🎯 Your Task

Produce a left-aligned triangle with spaces and stars.

📥 Input Format

Read one positive integer N that controls the number of rows in the pattern.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 20

Example Input
4
Example Output
* 
    * * 
  * * * 
* * * *
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Nested LoopsEasy+40 Points
CHALLENGE 06Easy+

Reverse Left Light Ramp

Core Skill: Inverted Left Triangle

Nested LoopsOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Reverse Left Light Ramp

The Reverse Left Light Ramp controls a row-by-row TechFest display. Use nested loops to produce an inverted left-aligned triangle.

🎯 Your Task

Produce an inverted left-aligned triangle.

📥 Input Format

Read one positive integer N that controls the number of rows in the pattern.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 20

Example Input
4
Example Output
* * * * 
  * * * 
    * * 
      *
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Nested LoopsEasy+40 Points
CHALLENGE 07Easy+

Main Stage Pyramid

Core Skill: Pyramid Pattern

Nested LoopsOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Main Stage Pyramid

The Main Stage Pyramid controls a row-by-row TechFest display. Use nested loops to produce a centered pyramid using stars.

🎯 Your Task

Produce a centered pyramid using stars.

📥 Input Format

Read one positive integer N that controls the number of rows in the pattern.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 20

Example Input
4
Example Output
* 
    * * * 
  * * * * * 
* * * * * * *
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Nested LoopsEasy+40 Points
CHALLENGE 08Easy+

Closing Ceremony Pyramid

Core Skill: Inverted Pyramid

Nested LoopsOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Closing Ceremony Pyramid

The Closing Ceremony Pyramid controls a row-by-row TechFest display. Use nested loops to produce an inverted centered pyramid.

🎯 Your Task

Produce an inverted centered pyramid.

📥 Input Format

Read one positive integer N that controls the number of rows in the pattern.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 20

Example Input
4
Example Output
* * * * * * * 
  * * * * * 
    * * * 
      *
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Nested LoopsEasy+40 Points
CHALLENGE 09Intermediate

Diamond Laser Frame

Core Skill: Diamond Pattern

Nested LoopsOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Diamond Laser Frame

The Diamond Laser Frame controls a row-by-row TechFest display. Use nested loops to produce a diamond pattern using stars.

🎯 Your Task

Produce a diamond pattern using stars.

📥 Input Format

Read one positive integer N that controls the number of rows in the pattern.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 20

Example Input
3
Example Output
* 
  * * * 
* * * * * 
  * * * 
    *
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Nested LoopsIntermediate60 Points
CHALLENGE 10Moderate

Hollow Sponsor Square

Core Skill: Hollow Square

Nested LoopsOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Hollow Sponsor Square

The Hollow Sponsor Square controls a row-by-row TechFest display. Use nested loops to produce a hollow square using stars.

🎯 Your Task

Produce a hollow square using stars.

📥 Input Format

Read one positive integer N that controls the number of rows in the pattern.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 20

Example Input
5
Example Output
* * * * * 
*       * 
*       * 
*       * 
* * * * *
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Nested LoopsModerate50 Points
CHALLENGE 11Moderate

Hollow Entry Banner

Core Skill: Hollow Rectangle

Nested LoopsOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Hollow Entry Banner

The Hollow Entry Banner controls a row-by-row TechFest display. Use nested loops to produce a hollow rectangle.

🎯 Your Task

Produce a hollow rectangle.

📥 Input Format

Read one positive integer N that controls the number of rows in the pattern.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 20

Example Input
4 6
Example Output
* * * * * * 
*         * 
*         * 
* * * * * *
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Nested LoopsModerate50 Points
CHALLENGE 12Intermediate

Hollow Triangle Arch

Core Skill: Hollow Triangle

Nested LoopsOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Hollow Triangle Arch

The Hollow Triangle Arch controls a row-by-row TechFest display. Use nested loops to produce a hollow right triangle.

🎯 Your Task

Produce a hollow right triangle.

📥 Input Format

Read one positive integer N that controls the number of rows in the pattern.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 20

Example Input
5
Example Output
* 
* * 
*   * 
*     * 
* * * * *
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Nested LoopsIntermediate60 Points
CHALLENGE 13Easy+

Seat Number Triangle

Core Skill: Number Triangle

Nested LoopsOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Seat Number Triangle

The Seat Number Triangle controls a row-by-row TechFest display. Use nested loops to produce numbers from 1 to the row number.

🎯 Your Task

Produce numbers from 1 to the row number.

📥 Input Format

Read one positive integer N that controls the number of rows in the pattern.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 20

Example Input
5
Example Output
1 
1 2 
1 2 3 
1 2 3 4 
1 2 3 4 5
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Nested LoopsEasy+40 Points
CHALLENGE 14Easy+

Reverse Seat Number Triangle

Core Skill: Inverted Number Triangle

Nested LoopsOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Reverse Seat Number Triangle

The Reverse Seat Number Triangle controls a row-by-row TechFest display. Use nested loops to produce an inverted number triangle.

🎯 Your Task

Produce an inverted number triangle.

📥 Input Format

Read one positive integer N that controls the number of rows in the pattern.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 20

Example Input
5
Example Output
1 2 3 4 5 
1 2 3 4 
1 2 3 
1 2 
1
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Nested LoopsEasy+40 Points
CHALLENGE 15Moderate

Continuous Token Triangle

Core Skill: Continuous Number Triangle

Nested LoopsOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Continuous Token Triangle

The Continuous Token Triangle controls a row-by-row TechFest display. Use nested loops to produce consecutive numbers in triangle form.

🎯 Your Task

Produce consecutive numbers in triangle form.

📥 Input Format

Read one positive integer N that controls the number of rows in the pattern.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 20

Example Input
4
Example Output
1 
2 3 
4 5 6 
7 8 9 10
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Nested LoopsModerate50 Points
CHALLENGE 16Easy+

Floyd Registration Board

Core Skill: Floyd's Triangle

Nested LoopsOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Floyd Registration Board

The Floyd Registration Board controls a row-by-row TechFest display. Use nested loops to produce Floyd's triangle.

🎯 Your Task

Produce floyd's triangle.

📥 Input Format

Read one positive integer N that controls the number of rows in the pattern.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 20

Example Input
5
Example Output
1 
2 3 
4 5 6 
7 8 9 10 
11 12 13 14 15
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Nested LoopsEasy+40 Points
CHALLENGE 17Easy+

Alphabet Spotlight Triangle

Core Skill: Alphabet Triangle

Nested LoopsOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Alphabet Spotlight Triangle

The Alphabet Spotlight Triangle controls a row-by-row TechFest display. Use nested loops to produce alphabets in triangle form.

🎯 Your Task

Produce alphabets in triangle form.

📥 Input Format

Read one positive integer N that controls the number of rows in the pattern.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 20

Example Input
4
Example Output
A 
A B 
A B C 
A B C D
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Nested LoopsEasy+40 Points
CHALLENGE 18Easy+

Repeated Row Number Board

Core Skill: Repeated Number Pattern

Nested LoopsOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Repeated Row Number Board

The Repeated Row Number Board controls a row-by-row TechFest display. Use nested loops to produce the row number repeatedly in each row.

🎯 Your Task

Produce the row number repeatedly in each row.

📥 Input Format

Read one positive integer N that controls the number of rows in the pattern.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 20

Example Input
5
Example Output
1 
2 2 
3 3 3 
4 4 4 4 
5 5 5 5 5
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Nested LoopsEasy+40 Points
CHALLENGE 19Easy+

Binary Light Triangle

Core Skill: -1 Triangle

Nested LoopsOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Binary Light Triangle

The Binary Light Triangle controls a row-by-row TechFest display. Use nested loops to produce a triangle using alternating 0 and 1.

🎯 Your Task

Produce a triangle using alternating 0 and 1.

📥 Input Format

Read one positive integer N that controls the number of rows in the pattern.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 20

Example Input
5
Example Output
1 
0 1 
1 0 1 
0 1 0 1 
1 0 1 0 1
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Nested LoopsEasy+40 Points
CHALLENGE 20Intermediate+

Pascal Spotlight Pyramid

Core Skill: Pascal's Triangle

Nested LoopsOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Pascal Spotlight Pyramid

The Pascal Spotlight Pyramid controls a row-by-row TechFest display. Use nested loops to produce Pascal's triangle for N rows.

🎯 Your Task

Produce pascal's triangle for n rows.

📥 Input Format

Read one positive integer N that controls the number of rows in the pattern.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 20

Example Input
5
Example Output
1 
      1 1 
    1 2 1 
  1 3 3 1 
1 4 6 4 1
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Nested LoopsIntermediate+70 Points
📊Level 5 — Array ChallengesTraversal, searching, duplicates, merging and rotations. • 20 original CodeBhavya challenges
Open 20 Challenges

Every challenge keeps the original C-learning objective from this level, while the story, framing and presentation are newly written for CodeBhavya.

CHALLENGE 01Easy

Sensor Reading Console

Core Skill: Read and Print an Array

ArraysOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Sensor Reading Console

The Sensor Reading Console stores campus readings in an array. Process those values to accept N elements into an array and print them.

🎯 Your Task

Accept n elements into an array and print them.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100; array values fit in a 32-bit signed integer.

Example Input
5
10 20 30 40 50
Example Output
10 20 30 40 50
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysEasy30 Points
CHALLENGE 02Easy

Solar Output Total

Core Skill: Sum of Array Elements

ArraysOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Solar Output Total

The Solar Output Total stores campus readings in an array. Process those values to determine the sum of all elements in an array.

🎯 Your Task

Determine the sum of all elements in an array.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100; array values fit in a 32-bit signed integer.

Example Input
5
10 20 30 40 50
Example Output
150
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysEasy30 Points
CHALLENGE 03Easy+

Average Lab Temperature

Core Skill: Average of Array Elements

ArraysOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Average Lab Temperature

The Average Lab Temperature stores campus readings in an array. Process those values to determine the average of all elements in an array.

🎯 Your Task

Determine the average of all elements in an array.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100; array values fit in a 32-bit signed integer.

Example Input
4
10 20 30 40
Example Output
25.00
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysEasy+40 Points
CHALLENGE 04Easy+

Coding Contest Peak Score

Core Skill: Find Maximum Element

ComparisonOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Coding Contest Peak Score

The Coding Contest Peak Score stores campus readings in an array. Process those values to determine the largest element in an array.

🎯 Your Task

Determine the largest element in an array.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100; array values fit in a 32-bit signed integer.

Example Input
5
10 45 23 67 12
Example Output
67
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ComparisonEasy+40 Points
CHALLENGE 05Easy+

Canteen Stock Minimum

Core Skill: Find Minimum Element

ComparisonOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Canteen Stock Minimum

The Canteen Stock Minimum stores campus readings in an array. Process those values to determine the smallest element in an array.

🎯 Your Task

Determine the smallest element in an array.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100; array values fit in a 32-bit signed integer.

Example Input
5
10 45 23 67 12
Example Output
10
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ComparisonEasy+40 Points
CHALLENGE 06Easy+

Even Device Counter

Core Skill: Count Even Elements

ArraysOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Even Device Counter

The Even Device Counter stores campus readings in an array. Process those values to count how many even numbers are present in an array.

🎯 Your Task

Count how many even numbers are present in an array.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100; array values fit in a 32-bit signed integer.

Example Input
6
1 2 4 7 8 9
Example Output
3
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysEasy+40 Points
CHALLENGE 07Easy+

Odd Device Counter

Core Skill: Count Odd Elements

ArraysOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Odd Device Counter

The Odd Device Counter stores campus readings in an array. Process those values to count how many odd numbers are present in an array.

🎯 Your Task

Count how many odd numbers are present in an array.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100; array values fit in a 32-bit signed integer.

Example Input
6
1 2 4 7 8 9
Example Output
3
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysEasy+40 Points
CHALLENGE 08Easy+

Power Reading Sign Counter

Core Skill: Count Positive and Negative Elements

ArraysOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Power Reading Sign Counter

The Power Reading Sign Counter stores campus readings in an array. Process those values to count positive, negative and zero elements.

🎯 Your Task

Count positive, negative and zero elements.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100; array values fit in a 32-bit signed integer.

Example Input
6
10 -5 0 8 -2 7
Example Output
Positive = 3
Negative = 2
Zero = 1
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysEasy+40 Points
CHALLENGE 09Moderate

Shuttle Log Reversal

Core Skill: Reverse an Array

ArraysOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Shuttle Log Reversal

The Shuttle Log Reversal stores campus readings in an array. Process those values to produce the elements of an array in reverse order.

🎯 Your Task

Produce the elements of an array in reverse order.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100; array values fit in a 32-bit signed integer.

Example Input
5
10 20 30 40 50
Example Output
50 40 30 20 10
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysModerate50 Points
CHALLENGE 10Easy+

Backup Reading Copier

Core Skill: Copy One Array into Another

ArraysOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Backup Reading Copier

The Backup Reading Copier stores campus readings in an array. Process those values to copy all elements from one array into another.

🎯 Your Task

Copy all elements from one array into another.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100; array values fit in a 32-bit signed integer.

Example Input
4
10 20 30 40
Example Output
10 20 30 40
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysEasy+40 Points
CHALLENGE 11Moderate

Library Shelf Search

Core Skill: Linear Search

SearchingOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Library Shelf Search

The Library Shelf Search stores campus readings in an array. Process those values to search for an element in an array using linear search.

🎯 Your Task

Search for an element in an array using linear search.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100; array values fit in a 32-bit signed integer.

Example Input
5
10 20 30 40 50
30
Example Output
Element found at index 2
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
SearchingModerate50 Points
CHALLENGE 12Intermediate

Runner-Up Contest Score

Core Skill: Second Largest Element

ComparisonOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Runner-Up Contest Score

The Runner-Up Contest Score stores campus readings in an array. Process those values to determine the second largest distinct element.

🎯 Your Task

Determine the second largest distinct element.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100; array values fit in a 32-bit signed integer.

Example Input
5
10 50 20 40 30
Example Output
40
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ComparisonIntermediate60 Points
CHALLENGE 13Intermediate

Second-Lowest Energy Reading

Core Skill: Second Smallest Element

ComparisonOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Second-Lowest Energy Reading

The Second-Lowest Energy Reading stores campus readings in an array. Process those values to determine the second smallest distinct element.

🎯 Your Task

Determine the second smallest distinct element.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100; array values fit in a 32-bit signed integer.

Example Input
5
10 50 20 40 30
Example Output
20
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ComparisonIntermediate60 Points
CHALLENGE 14Intermediate+

Duplicate Entry Cleaner

Core Skill: Remove Duplicate Elements

Duplicate HandlingOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Duplicate Entry Cleaner

The Duplicate Entry Cleaner stores campus readings in an array. Process those values to remove duplicate values from an array and print only distinct elements.

🎯 Your Task

Remove duplicate values from an array and print only distinct elements.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100; array values fit in a 32-bit signed integer.

Example Input
7
10 20 10 30 20 40 10
Example Output
10 20 30 40
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Duplicate HandlingIntermediate+70 Points
CHALLENGE 15Intermediate+

Sensor Frequency Report

Core Skill: Frequency of Each Element

CountingOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Sensor Frequency Report

The Sensor Frequency Report stores campus readings in an array. Process those values to count the frequency of every distinct element.

🎯 Your Task

Count the frequency of every distinct element.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100; array values fit in a 32-bit signed integer.

Example Input
6
10 20 10 30 20 10
Example Output
10 = 3
20 = 2
30 = 1
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
CountingIntermediate+70 Points
CHALLENGE 16Intermediate+

Missing Locker Token

Core Skill: Find Missing Number

ArraysOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Missing Locker Token

The Missing Locker Token stores campus readings in an array. Process those values to an array contains numbers from 1 to N with one number missing. Find the missing number.

🎯 Your Task

An array contains numbers from 1 to n with one number missing. find the missing number.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100; array values fit in a 32-bit signed integer.

Example Input
5
1 2 4 5
Example Output
3
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysIntermediate+70 Points
CHALLENGE 17Moderate

Two-Block Reading Merge

Core Skill: Merge Two Arrays

ArraysOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Two-Block Reading Merge

The Two-Block Reading Merge stores campus readings in an array. Process those values to merge two arrays into a single array.

🎯 Your Task

Merge two arrays into a single array.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100; array values fit in a 32-bit signed integer.

Example Input
3
1 2 3
2
4 5
Example Output
1 2 3 4 5
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysModerate50 Points
CHALLENGE 18Intermediate+

Sorted Attendance Merge

Core Skill: Merge Two Sorted Arrays

ArraysSortingOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Sorted Attendance Merge

The Sorted Attendance Merge stores campus readings in an array. Process those values to merge two sorted arrays into one sorted array.

🎯 Your Task

Merge two sorted arrays into one sorted array.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100; array values fit in a 32-bit signed integer.

Example Input
3
1 3 5
3
2 4 6
Example Output
1 2 3 4 5 6
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysSortingIntermediate+70 Points
CHALLENGE 19Intermediate

Left Shift Shuttle Schedule

Core Skill: Left Rotate an Array

ArraysArray RotationOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Left Shift Shuttle Schedule

The Left Shift Shuttle Schedule stores campus readings in an array. Process those values to rotate an array to the left by one position.

🎯 Your Task

Rotate an array to the left by one position.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100; array values fit in a 32-bit signed integer.

Example Input
5
1 2 3 4 5
Example Output
2 3 4 5 1
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysArray RotationIntermediate60 Points
CHALLENGE 20Intermediate

Right Shift Shuttle Schedule

Core Skill: Right Rotate an Array

ArraysArray RotationOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Right Shift Shuttle Schedule

The Right Shift Shuttle Schedule stores campus readings in an array. Process those values to rotate an array to the right by one position.

🎯 Your Task

Rotate an array to the right by one position.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100; array values fit in a 32-bit signed integer.

Example Input
5
1 2 3 4 5
Example Output
5 1 2 3 4
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysArray RotationIntermediate60 Points
🔤Level 6 — String ChallengesCharacter processing, transformations, searching and text analysis. • 20 original CodeBhavya challenges
Open 20 Challenges

Every challenge keeps the original C-learning objective from this level, while the story, framing and presentation are newly written for CodeBhavya.

CHALLENGE 01Easy

Message Display Terminal

Core Skill: Read and Print a String

StringsOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Message Display Terminal

The Message Display Terminal receives text from a campus service. Process the characters to accept a string and print it.

🎯 Your Task

Accept a string and print it.

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Input text length ≤ 200 characters unless otherwise stated.

Example Input
Hello
Example Output
Hello
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StringsEasy30 Points
CHALLENGE 02Easy+

Notice Length Meter

Core Skill: Find String Length

StringsOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Notice Length Meter

The Notice Length Meter receives text from a campus service. Process the characters to determine the length of a string without using strlen() .

🎯 Your Task

Determine the length of a string without using strlen() .

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Input text length ≤ 200 characters unless otherwise stated.

Example Input
Hello
Example Output
5
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StringsEasy+40 Points
CHALLENGE 03Easy+

Badge Text Character Counter

Core Skill: Count Characters

StringsOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Badge Text Character Counter

The Badge Text Character Counter receives text from a campus service. Process the characters to count the number of characters in a string without using strlen() .

🎯 Your Task

Count the number of characters in a string without using strlen() .

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Input text length ≤ 200 characters unless otherwise stated.

Example Input
Programming
Example Output
11
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StringsEasy+40 Points
CHALLENGE 04Easy+

Announcement Vowel Meter

Core Skill: Count Vowels

StringsOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Announcement Vowel Meter

The Announcement Vowel Meter receives text from a campus service. Process the characters to count the vowels in a string.

🎯 Your Task

Count the vowels in a string.

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Input text length ≤ 200 characters unless otherwise stated.

Example Input
education
Example Output
5
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StringsEasy+40 Points
CHALLENGE 05Easy+

Announcement Consonant Meter

Core Skill: Count Consonants

StringsOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Announcement Consonant Meter

The Announcement Consonant Meter receives text from a campus service. Process the characters to count consonants in a string containing alphabets.

🎯 Your Task

Count consonants in a string containing alphabets.

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Input text length ≤ 200 characters unless otherwise stated.

Example Input
hello
Example Output
3
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StringsEasy+40 Points
CHALLENGE 06Easy+

Secure Message Digit Counter

Core Skill: Count Digits in a String

StringsOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Secure Message Digit Counter

The Secure Message Digit Counter receives text from a campus service. Process the characters to count how many numeric digits are present in a string.

🎯 Your Task

Count how many numeric digits are present in a string.

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Input text length ≤ 200 characters unless otherwise stated.

Example Input
abc123xyz45
Example Output
5
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StringsEasy+40 Points
CHALLENGE 07Easy

Sentence Space Counter

Core Skill: Count Spaces

StringsOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Sentence Space Counter

The Sentence Space Counter receives text from a campus service. Process the characters to count the spaces in a sentence.

🎯 Your Task

Count the spaces in a sentence.

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Input text length ≤ 200 characters unless otherwise stated.

Example Input
C programming is easy
Example Output
3
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StringsEasy30 Points
CHALLENGE 08Easy+

Lowercase Notice Upgrader

Core Skill: Convert Lowercase to Uppercase

StringsOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Lowercase Notice Upgrader

The Lowercase Notice Upgrader receives text from a campus service. Process the characters to convert all lowercase letters to uppercase without using strupr() .

🎯 Your Task

Convert all lowercase letters to uppercase without using strupr() .

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Input text length ≤ 200 characters unless otherwise stated.

Example Input
hello
Example Output
HELLO
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StringsEasy+40 Points
CHALLENGE 09Easy+

Uppercase Notice Normalizer

Core Skill: Convert Uppercase to Lowercase

StringsOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Uppercase Notice Normalizer

The Uppercase Notice Normalizer receives text from a campus service. Process the characters to convert uppercase letters to lowercase.

🎯 Your Task

Convert uppercase letters to lowercase.

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Input text length ≤ 200 characters unless otherwise stated.

Example Input
HELLO
Example Output
hello
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StringsEasy+40 Points
CHALLENGE 10Moderate

Mirror Message Tool

Core Skill: Reverse a String

StringsOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Mirror Message Tool

The Mirror Message Tool receives text from a campus service. Process the characters to reverse a string without using strrev() .

🎯 Your Task

Reverse a string without using strrev() .

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Input text length ≤ 200 characters unless otherwise stated.

Example Input
hello
Example Output
olleh
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StringsModerate50 Points
CHALLENGE 11Moderate

Palindrome Badge Check

Core Skill: Palindrome String

StringsPalindromeOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Palindrome Badge Check

The Palindrome Badge Check receives text from a campus service. Process the characters to determine whether a string is a palindrome.

🎯 Your Task

Determine whether a string is a palindrome.

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Input text length ≤ 200 characters unless otherwise stated.

Example Input
madam
Example Output
Palindrome
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StringsPalindromeModerate50 Points
CHALLENGE 12Easy+

Message Backup Copier

Core Skill: Copy a String

StringsOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Message Backup Copier

The Message Backup Copier receives text from a campus service. Process the characters to copy one string into another without using strcpy() .

🎯 Your Task

Copy one string into another without using strcpy() .

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Input text length ≤ 200 characters unless otherwise stated.

Example Input
Hello
Example Output
Hello
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StringsEasy+40 Points
CHALLENGE 13Moderate

Two-Notice Comparator

Core Skill: Compare Two Strings

StringsOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Two-Notice Comparator

The Two-Notice Comparator receives text from a campus service. Process the characters to compare two strings without using strcmp() .

🎯 Your Task

Compare two strings without using strcmp() .

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Input text length ≤ 200 characters unless otherwise stated.

Example Input
hello
hello
Example Output
Equal
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StringsModerate50 Points
CHALLENGE 14Moderate

Notice Merger

Core Skill: Concatenate Two Strings

StringsOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Notice Merger

The Notice Merger receives text from a campus service. Process the characters to concatenate two strings without using strcat() .

🎯 Your Task

Concatenate two strings without using strcat() .

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Input text length ≤ 200 characters unless otherwise stated.

Example Input
Hello
World
Example Output
HelloWorld
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StringsModerate50 Points
CHALLENGE 15Moderate

Target Letter Frequency Desk

Core Skill: Frequency of a Character

CountingOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Target Letter Frequency Desk

The Target Letter Frequency Desk receives text from a campus service. Process the characters to count how many times a character occurs in a string.

🎯 Your Task

Count how many times a character occurs in a string.

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Input text length ≤ 200 characters unless otherwise stated.

Example Input
programming
g
Example Output
2
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
CountingModerate50 Points
CHALLENGE 16Moderate

Compact Message Cleaner

Core Skill: Remove Spaces

StringsOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Compact Message Cleaner

The Compact Message Cleaner receives text from a campus service. Process the characters to remove all spaces from a sentence.

🎯 Your Task

Remove all spaces from a sentence.

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Input text length ≤ 200 characters unless otherwise stated.

Example Input
C programming is easy
Example Output
Cprogrammingiseasy
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StringsModerate50 Points
CHALLENGE 17Intermediate+

Duplicate Character Cleaner

Core Skill: Remove Duplicate Characters

Duplicate HandlingOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Duplicate Character Cleaner

The Duplicate Character Cleaner receives text from a campus service. Process the characters to remove duplicate characters from a string.

🎯 Your Task

Remove duplicate characters from a string.

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Input text length ≤ 200 characters unless otherwise stated.

Example Input
programming
Example Output
progamin
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Duplicate HandlingIntermediate+70 Points
CHALLENGE 18Intermediate+

First Unique Symbol Finder

Core Skill: First Non-Repeating Character

StringsOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

First Unique Symbol Finder

The First Unique Symbol Finder receives text from a campus service. Process the characters to determine the first character that occurs only once.

🎯 Your Task

Determine the first character that occurs only once.

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Input text length ≤ 200 characters unless otherwise stated.

Example Input
aabbcdde
Example Output
c
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StringsIntermediate+70 Points
CHALLENGE 19Intermediate+

Team Name Anagram Check

Core Skill: Check Anagram

Character FrequencyOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Team Name Anagram Check

The Team Name Anagram Check receives text from a campus service. Process the characters to determine whether two strings are anagrams.

🎯 Your Task

Determine whether two strings are anagrams.

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Input text length ≤ 200 characters unless otherwise stated.

Example Input
listen
silent
Example Output
Anagram
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Character FrequencyIntermediate+70 Points
CHALLENGE 20Moderate

Sentence Word Counter

Core Skill: Count Words in a Sentence

StringsOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Sentence Word Counter

The Sentence Word Counter receives text from a campus service. Process the characters to count the number of words in a sentence.

🎯 Your Task

Count the number of words in a sentence.

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Input text length ≤ 200 characters unless otherwise stated.

Example Input
C programming is easy
Example Output
4
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StringsModerate50 Points
⚙️Level 7 — Functions & RecursionReusable functions, recursion and structured decomposition. • 20 original CodeBhavya challenges
Open 20 Challenges

Every challenge keeps the original C-learning objective from this level, while the story, framing and presentation are newly written for CodeBhavya.

CHALLENGE 01Easy

Reusable Addition Service

Core Skill: Add Two Numbers Using Function

FunctionsOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Reusable Addition Service

The Reusable Addition Service is being converted into reusable C components. Use functions or recursion to write a function to add two numbers and return the result.

🎯 Your Task

Write a function to add two numbers and return the result.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Keep recursive input sizes small enough to avoid excessive recursion depth.

Example Input
10 20
Example Output
30
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
FunctionsEasy30 Points
CHALLENGE 02Easy

Reusable Maximum Service

Core Skill: Find Maximum Using Function

FunctionsComparisonOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Reusable Maximum Service

The Reusable Maximum Service is being converted into reusable C components. Use functions or recursion to write a function to find the larger of two numbers.

🎯 Your Task

Write a function to find the larger of two numbers.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Keep recursive input sizes small enough to avoid excessive recursion depth.

Example Input
25 18
Example Output
25
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
FunctionsComparisonEasy30 Points
CHALLENGE 03Easy

Parity Check Service

Core Skill: Check Even or Odd Using Function

FunctionsOnline Judge30 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Parity Check Service

The Parity Check Service is being converted into reusable C components. Use functions or recursion to write a function to check whether a number is even or odd.

🎯 Your Task

Write a function to check whether a number is even or odd.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Keep recursive input sizes small enough to avoid excessive recursion depth.

Example Input
24
Example Output
Even
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
FunctionsEasy30 Points
CHALLENGE 04Easy+

Factorial Service Desk

Core Skill: Find Factorial Using Function

FunctionsOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Factorial Service Desk

The Factorial Service Desk is being converted into reusable C components. Use functions or recursion to write a function to find the factorial of a number.

🎯 Your Task

Write a function to find the factorial of a number.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Keep recursive input sizes small enough to avoid excessive recursion depth.

Example Input
5
Example Output
120
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
FunctionsEasy+40 Points
CHALLENGE 05Moderate

Prime Validation Service

Core Skill: Check Prime Using Function

FunctionsNumber TheoryOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Prime Validation Service

The Prime Validation Service is being converted into reusable C components. Use functions or recursion to write a function to check whether a number is prime.

🎯 Your Task

Write a function to check whether a number is prime.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Keep recursive input sizes small enough to avoid excessive recursion depth.

Example Input
17
Example Output
Prime
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
FunctionsNumber TheoryModerate50 Points
CHALLENGE 06Easy+

Number Reversal Service

Core Skill: Reverse Number Using Function

FunctionsOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Number Reversal Service

The Number Reversal Service is being converted into reusable C components. Use functions or recursion to write a function to reverse a number.

🎯 Your Task

Write a function to reverse a number.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Keep recursive input sizes small enough to avoid excessive recursion depth.

Example Input
12345
Example Output
54321
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
FunctionsEasy+40 Points
CHALLENGE 07Moderate

Fibonacci Service

Core Skill: Fibonacci Using Function

FunctionsOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Fibonacci Service

The Fibonacci Service is being converted into reusable C components. Use functions or recursion to write a function to print the first N Fibonacci numbers.

🎯 Your Task

Write a function to print the first n fibonacci numbers.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Keep recursive input sizes small enough to avoid excessive recursion depth.

Example Input
7
Example Output
0 1 1 2 3 5 8
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
FunctionsModerate50 Points
CHALLENGE 08Moderate

Common-Divisor Service

Core Skill: GCD Using Function

FunctionsNumber TheoryOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Common-Divisor Service

The Common-Divisor Service is being converted into reusable C components. Use functions or recursion to determine the greatest common divisor of two numbers.

🎯 Your Task

Determine the greatest common divisor of two numbers.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Keep recursive input sizes small enough to avoid excessive recursion depth.

Example Input
24 36
Example Output
12
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
FunctionsNumber TheoryModerate50 Points
CHALLENGE 09Moderate

Power Calculation Service

Core Skill: Power Using Function

FunctionsOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Power Calculation Service

The Power Calculation Service is being converted into reusable C components. Use functions or recursion to compute a raised to the power b using a function.

🎯 Your Task

Compute a raised to the power b using a function.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Keep recursive input sizes small enough to avoid excessive recursion depth.

Example Input
2 5
Example Output
32
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
FunctionsModerate50 Points
CHALLENGE 10Moderate

Recursive Factorial Engine

Core Skill: Factorial Using Recursion

RecursionOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Recursive Factorial Engine

The Recursive Factorial Engine is being converted into reusable C components. Use functions or recursion to determine the factorial of a number using recursion.

🎯 Your Task

Determine the factorial of a number using recursion.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Keep recursive input sizes small enough to avoid excessive recursion depth.

Example Input
5
Example Output
120
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
RecursionModerate50 Points
CHALLENGE 11Intermediate+

Recursive Fibonacci Engine

Core Skill: Fibonacci Using Recursion

RecursionOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Recursive Fibonacci Engine

The Recursive Fibonacci Engine is being converted into reusable C components. Use functions or recursion to determine the Nth Fibonacci number using recursion.

🎯 Your Task

Determine the nth fibonacci number using recursion.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Keep recursive input sizes small enough to avoid excessive recursion depth.

Example Input
6
Example Output
8
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
RecursionIntermediate+70 Points
CHALLENGE 12Easy+

Recursive Natural Sum Engine

Core Skill: Sum of Natural Numbers Using Recursion

RecursionOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Recursive Natural Sum Engine

The Recursive Natural Sum Engine is being converted into reusable C components. Use functions or recursion to determine the sum of the first N natural numbers using recursion.

🎯 Your Task

Determine the sum of the first n natural numbers using recursion.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Keep recursive input sizes small enough to avoid excessive recursion depth.

Example Input
10
Example Output
55
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
RecursionEasy+40 Points
CHALLENGE 13Moderate

Recursive Digit Sum Engine

Core Skill: Sum of Digits Using Recursion

RecursionOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Recursive Digit Sum Engine

The Recursive Digit Sum Engine is being converted into reusable C components. Use functions or recursion to determine the sum of all digits of a number using recursion.

🎯 Your Task

Determine the sum of all digits of a number using recursion.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Keep recursive input sizes small enough to avoid excessive recursion depth.

Example Input
12345
Example Output
15
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
RecursionModerate50 Points
CHALLENGE 14Intermediate

Recursive Number Mirror

Core Skill: Reverse a Number Using Recursion

RecursionOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Recursive Number Mirror

The Recursive Number Mirror is being converted into reusable C components. Use functions or recursion to reverse a number using recursion.

🎯 Your Task

Reverse a number using recursion.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Keep recursive input sizes small enough to avoid excessive recursion depth.

Example Input
1234
Example Output
4321
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
RecursionIntermediate60 Points
CHALLENGE 15Intermediate+

Recursive Binary Converter

Core Skill: Decimal to Binary Using Recursion

RecursionOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Recursive Binary Converter

The Recursive Binary Converter is being converted into reusable C components. Use functions or recursion to convert a decimal number to binary using recursion.

🎯 Your Task

Convert a decimal number to binary using recursion.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Keep recursive input sizes small enough to avoid excessive recursion depth.

Example Input
10
Example Output
1010
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
RecursionIntermediate+70 Points
CHALLENGE 16Moderate

Array Maximum Service

Core Skill: Find Maximum in Array Using Function

ArraysFunctionsComparisonOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Array Maximum Service

The Array Maximum Service is being converted into reusable C components. Use functions or recursion to write a function to find the largest element in an array.

🎯 Your Task

Write a function to find the largest element in an array.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Keep recursive input sizes small enough to avoid excessive recursion depth.

Example Input
5
10 25 7 40 18
Example Output
40
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysFunctionsComparisonModerate50 Points
CHALLENGE 17Moderate

Array Parity Counter Service

Core Skill: Count Even and Odd Using Function

FunctionsOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Array Parity Counter Service

The Array Parity Counter Service is being converted into reusable C components. Use functions or recursion to count the number of even and odd elements in an array.

🎯 Your Task

Count the number of even and odd elements in an array.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Keep recursive input sizes small enough to avoid excessive recursion depth.

Example Input
6
1 2 3 4 5 6
Example Output
Even: 3
Odd: 3
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
FunctionsModerate50 Points
CHALLENGE 18Moderate

Palindrome Validation Service

Core Skill: Check Palindrome Using Function

FunctionsPalindromeOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Palindrome Validation Service

The Palindrome Validation Service is being converted into reusable C components. Use functions or recursion to determine whether a number is a palindrome using a function.

🎯 Your Task

Determine whether a number is a palindrome using a function.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Keep recursive input sizes small enough to avoid excessive recursion depth.

Example Input
1221
Example Output
Palindrome
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
FunctionsPalindromeModerate50 Points
CHALLENGE 19Intermediate

LCM Service Desk

Core Skill: LCM Using Function

FunctionsNumber TheoryOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

LCM Service Desk

The LCM Service Desk is being converted into reusable C components. Use functions or recursion to determine the least common multiple of two numbers.

🎯 Your Task

Determine the least common multiple of two numbers.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Keep recursive input sizes small enough to avoid excessive recursion depth.

Example Input
12 18
Example Output
36
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
FunctionsNumber TheoryIntermediate60 Points
CHALLENGE 20Advanced+

Tower Transfer Simulator

Core Skill: Tower of Hanoi

FunctionsOnline Judge90 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Tower Transfer Simulator

The Tower Transfer Simulator is being converted into reusable C components. Use functions or recursion to solve the Tower of Hanoi problem using recursion.

🎯 Your Task

Solve the tower of hanoi problem using recursion.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Keep recursive input sizes small enough to avoid excessive recursion depth.

Example Input
3
Example Output
Move disk 1 from A to C
Move disk 2 from A to B
Move disk 1 from C to B
Move disk 3 from A to C
Move disk 1 from B to A
Move disk 2 from B to C
Move disk 1 from A to C
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
FunctionsAdvanced+90 Points
📍Level 8 — Pointers & Dynamic MemoryAddresses, pointers, dynamic arrays, strings and matrices. • 20 original CodeBhavya challenges
Open 20 Challenges

Every challenge keeps the original C-learning objective from this level, while the story, framing and presentation are newly written for CodeBhavya.

CHALLENGE 01Easy+

Address Inspector

Core Skill: Print Value Using Pointer

PointersOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Address Inspector

The Address Inspector works with addresses or runtime-sized storage. Use pointers or dynamic memory to store a number in a variable and print its value using a pointer.

🎯 Your Task

Store a number in a variable and print its value using a pointer.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100 for runtime-sized arrays/matrices; check allocations before use.

Example Input
25
Example Output
25
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
PointersEasy+40 Points
CHALLENGE 02Easy+

Remote Value Updater

Core Skill: Change Value Using Pointer

PointersOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Remote Value Updater

The Remote Value Updater works with addresses or runtime-sized storage. Use pointers or dynamic memory to change the value of a variable using a pointer.

🎯 Your Task

Change the value of a variable using a pointer.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100 for runtime-sized arrays/matrices; check allocations before use.

Example Input
10
Example Output
50
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
PointersEasy+40 Points
CHALLENGE 03Moderate

Pointer Swap Station

Core Skill: Swap Two Numbers Using Pointers

PointersOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Pointer Swap Station

The Pointer Swap Station works with addresses or runtime-sized storage. Use pointers or dynamic memory to swap two numbers using a function and pointers.

🎯 Your Task

Swap two numbers using a function and pointers.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100 for runtime-sized arrays/matrices; check allocations before use.

Example Input
10 20
Example Output
20 10
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
PointersModerate50 Points
CHALLENGE 04Moderate

Pointer Array Sum Desk

Core Skill: Sum Array Using Pointer

ArraysPointersOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Pointer Array Sum Desk

The Pointer Array Sum Desk works with addresses or runtime-sized storage. Use pointers or dynamic memory to determine the sum of array elements using pointer arithmetic.

🎯 Your Task

Determine the sum of array elements using pointer arithmetic.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100 for runtime-sized arrays/matrices; check allocations before use.

Example Input
5
10 20 30 40 50
Example Output
150
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysPointersModerate50 Points
CHALLENGE 05Moderate

Pointer Maximum Scanner

Core Skill: Find Maximum Using Pointer

PointersComparisonOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Pointer Maximum Scanner

The Pointer Maximum Scanner works with addresses or runtime-sized storage. Use pointers or dynamic memory to determine the largest element in an array using pointers.

🎯 Your Task

Determine the largest element in an array using pointers.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100 for runtime-sized arrays/matrices; check allocations before use.

Example Input
5
12 45 7 30 20
Example Output
45
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
PointersComparisonModerate50 Points
CHALLENGE 06Intermediate

Pointer Array Reversal

Core Skill: Reverse Array Using Pointers

ArraysPointersOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Pointer Array Reversal

The Pointer Array Reversal works with addresses or runtime-sized storage. Use pointers or dynamic memory to reverse an array using pointers.

🎯 Your Task

Reverse an array using pointers.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100 for runtime-sized arrays/matrices; check allocations before use.

Example Input
5
1 2 3 4 5
Example Output
5 4 3 2 1
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysPointersIntermediate60 Points
CHALLENGE 07Moderate

Pointer Element Counter

Core Skill: Count Array Elements Using Pointers

ArraysPointersOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Pointer Element Counter

The Pointer Element Counter works with addresses or runtime-sized storage. Use pointers or dynamic memory to count the number of elements in an array using pointers.

🎯 Your Task

Count the number of elements in an array using pointers.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100 for runtime-sized arrays/matrices; check allocations before use.

Example Input
6
10 20 30 40 50 60
Example Output
6
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysPointersModerate50 Points
CHALLENGE 08Intermediate

Dynamic Registration List

Core Skill: Dynamically Allocate an Array

ArraysDynamic MemoryOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Dynamic Registration List

The Dynamic Registration List works with addresses or runtime-sized storage. Use pointers or dynamic memory to allocate memory dynamically for N integers and print their sum.

🎯 Your Task

Allocate memory dynamically for n integers and print their sum.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100 for runtime-sized arrays/matrices; check allocations before use.

Example Input
5
10 20 30 40 50
Example Output
150
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysDynamic MemoryIntermediate60 Points
CHALLENGE 09Intermediate

Dynamic Score Average

Core Skill: Find Average Using Dynamic Memory

Dynamic MemoryOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Dynamic Score Average

The Dynamic Score Average works with addresses or runtime-sized storage. Use pointers or dynamic memory to dynamically allocate an array and find its average.

🎯 Your Task

Dynamically allocate an array and find its average.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100 for runtime-sized arrays/matrices; check allocations before use.

Example Input
4
10 20 30 40
Example Output
25.00
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Dynamic MemoryIntermediate60 Points
CHALLENGE 10Intermediate

Zeroed Seat Allocation

Core Skill: calloc() for Array

ArraysOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Zeroed Seat Allocation

The Zeroed Seat Allocation works with addresses or runtime-sized storage. Use pointers or dynamic memory to dynamically allocate an array using calloc() and display its initial values.

🎯 Your Task

Dynamically allocate an array using calloc() and display its initial values.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100 for runtime-sized arrays/matrices; check allocations before use.

Example Input
5
Example Output
0 0 0 0 0
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysIntermediate60 Points
CHALLENGE 11Intermediate+

Expandable Registration List

Core Skill: Resize Array Using realloc()

ArraysOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Expandable Registration List

The Expandable Registration List works with addresses or runtime-sized storage. Use pointers or dynamic memory to create an array of N elements and increase its size to M elements using realloc() .

🎯 Your Task

Create an array of n elements and increase its size to m elements using realloc() .

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100 for runtime-sized arrays/matrices; check allocations before use.

Example Input
3
10 20 30
5
40 50
Example Output
10 20 30 40 50
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysIntermediate+70 Points
CHALLENGE 12Intermediate

Pointer Function Sum

Core Skill: Find Sum Using Pointer Function

PointersFunctionsOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Pointer Function Sum

The Pointer Function Sum works with addresses or runtime-sized storage. Use pointers or dynamic memory to pass an array to a function using a pointer and find its sum.

🎯 Your Task

Pass an array to a function using a pointer and find its sum.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100 for runtime-sized arrays/matrices; check allocations before use.

Example Input
4
5 10 15 20
Example Output
50
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
PointersFunctionsIntermediate60 Points
CHALLENGE 13Intermediate

Pointer Seat Swap

Core Skill: Swap Array Elements Using Pointers

ArraysPointersOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Pointer Seat Swap

The Pointer Seat Swap works with addresses or runtime-sized storage. Use pointers or dynamic memory to swap two elements of an array using pointers.

🎯 Your Task

Swap two elements of an array using pointers.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100 for runtime-sized arrays/matrices; check allocations before use.

Example Input
5
10 20 30 40 50
1 4
Example Output
10 50 30 40 20
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysPointersIntermediate60 Points
CHALLENGE 14Intermediate

Pointer String Length Meter

Core Skill: Find String Length Using Pointer

StringsPointersOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Pointer String Length Meter

The Pointer String Length Meter works with addresses or runtime-sized storage. Use pointers or dynamic memory to determine the length of a string using a character pointer.

🎯 Your Task

Determine the length of a string using a character pointer.

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100 for runtime-sized arrays/matrices; check allocations before use.

Example Input
Hello
Example Output
5
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StringsPointersIntermediate60 Points
CHALLENGE 15Intermediate+

Pointer String Reversal

Core Skill: Reverse String Using Pointer

StringsPointersOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Pointer String Reversal

The Pointer String Reversal works with addresses or runtime-sized storage. Use pointers or dynamic memory to reverse a string using pointers.

🎯 Your Task

Reverse a string using pointers.

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100 for runtime-sized arrays/matrices; check allocations before use.

Example Input
hello
Example Output
olleh
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StringsPointersIntermediate+70 Points
CHALLENGE 16Intermediate+

Runtime Number Vault

Core Skill: Dynamic Memory for Multiple Numbers

Dynamic MemoryOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Runtime Number Vault

The Runtime Number Vault works with addresses or runtime-sized storage. Use pointers or dynamic memory to allocate memory dynamically and find the largest number.

🎯 Your Task

Allocate memory dynamically and find the largest number.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100 for runtime-sized arrays/matrices; check allocations before use.

Example Input
5
15 42 8 31 20
Example Output
42
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Dynamic MemoryIntermediate+70 Points
CHALLENGE 17Intermediate+

Runtime Name Buffer

Core Skill: Dynamic Memory for String

StringsDynamic MemoryOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Runtime Name Buffer

The Runtime Name Buffer works with addresses or runtime-sized storage. Use pointers or dynamic memory to dynamically allocate memory for a string and print it.

🎯 Your Task

Dynamically allocate memory for a string and print it.

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100 for runtime-sized arrays/matrices; check allocations before use.

Example Input
Programming
Example Output
Programming
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StringsDynamic MemoryIntermediate+70 Points
CHALLENGE 18Intermediate+

Double-Pointer Control Desk

Core Skill: Pointer to Pointer

PointersOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Double-Pointer Control Desk

The Double-Pointer Control Desk works with addresses or runtime-sized storage. Use pointers or dynamic memory to use a pointer to pointer to access the value of a variable.

🎯 Your Task

Use a pointer to pointer to access the value of a variable.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100 for runtime-sized arrays/matrices; check allocations before use.

Example Input
100
Example Output
100
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
PointersIntermediate+70 Points
CHALLENGE 19Advanced+

Dynamic Matrix Board

Core Skill: Dynamic Matrix

Dynamic MemoryOnline Judge90 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Dynamic Matrix Board

The Dynamic Matrix Board works with addresses or runtime-sized storage. Use pointers or dynamic memory to dynamically allocate memory for a matrix and print it.

🎯 Your Task

Dynamically allocate memory for a matrix and print it.

📥 Input Format

Read the matrix dimensions first, followed by the matrix elements in row-major order.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100 for runtime-sized arrays/matrices; check allocations before use.

Example Input
2 3
1 2 3
4 5 6
Example Output
1 2 3
4 5 6
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Dynamic MemoryAdvanced+90 Points
CHALLENGE 20Advanced

Pointer Runner-Up Scanner

Core Skill: Find Second Largest Using Pointers

PointersComparisonOnline Judge80 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Pointer Runner-Up Scanner

The Pointer Runner-Up Scanner works with addresses or runtime-sized storage. Use pointers or dynamic memory to determine the second largest element using pointer arithmetic.

🎯 Your Task

Determine the second largest element using pointer arithmetic.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 100 for runtime-sized arrays/matrices; check allocations before use.

Example Input
5
10 40 20 50 30
Example Output
40
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
PointersComparisonAdvanced80 Points
🧱Level 9 — Structures & Record FilesStructures, unions and record-oriented file handling. • 20 original CodeBhavya challenges
Open 20 Challenges

Every challenge keeps the original C-learning objective from this level, while the story, framing and presentation are newly written for CodeBhavya.

CHALLENGE 01Moderate

Student Profile Desk

Core Skill: Store Student Details Using Structure

StructuresOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Student Profile Desk

The Student Profile Desk manages structured campus records. Use structures, unions or files to create a structure to store a student's roll number, name and marks.

🎯 Your Task

Create a structure to store a student's roll number, name and marks.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use at most 100 records/items; check file operations before use.

Example Input
101
Ravi
85
Example Output
101 Ravi 85
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StructuresModerate50 Points
CHALLENGE 02Intermediate

Merit Record Finder

Core Skill: Find Student with Highest Marks

StructuresOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Merit Record Finder

The Merit Record Finder manages structured campus records. Use structures, unions or files to store details of N students and find the student with the highest marks.

🎯 Your Task

Store details of n students and find the student with the highest marks.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use at most 100 records/items; check file operations before use.

Example Input
3
101 Ravi 80
102 Sita 92
103 Arun 85
Example Output
Sita 92
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StructuresIntermediate60 Points
CHALLENGE 03Intermediate

Class Average Register

Core Skill: Average Marks Using Structure

StructuresOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Class Average Register

The Class Average Register manages structured campus records. Use structures, unions or files to compute the average marks of N students.

🎯 Your Task

Compute the average marks of n students.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use at most 100 records/items; check file operations before use.

Example Input
3
80
90
70
Example Output
80.00
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StructuresIntermediate60 Points
CHALLENGE 04Intermediate

Student Pointer Desk

Core Skill: Structure Pointer

PointersStructuresOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Student Pointer Desk

The Student Pointer Desk manages structured campus records. Use structures, unions or files to access structure members using a structure pointer.

🎯 Your Task

Access structure members using a structure pointer.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use at most 100 records/items; check file operations before use.

Example Input
101 Ravi 85
Example Output
101 Ravi 85
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
PointersStructuresIntermediate60 Points
CHALLENGE 05Moderate

Employee Salary Register

Core Skill: Employee Salary

StructuresOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Employee Salary Register

The Employee Salary Register manages structured campus records. Use structures, unions or files to store employee details using a structure and calculate the annual salary.

🎯 Your Task

Store employee details using a structure and calculate the annual salary.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use at most 100 records/items; check file operations before use.

Example Input
101
Ravi
25000
Example Output
300000
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StructuresModerate50 Points
CHALLENGE 06Intermediate

Roll Number Lookup

Core Skill: Search Student by Roll Number

SearchingOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Roll Number Lookup

The Roll Number Lookup manages structured campus records. Use structures, unions or files to search for a student using the roll number.

🎯 Your Task

Search for a student using the roll number.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use at most 100 records/items; check file operations before use.

Example Input
3
101 Ravi 80
102 Sita 90
103 Arun 85
102
Example Output
Sita 90
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
SearchingIntermediate60 Points
CHALLENGE 07Advanced

Merit List Sorter

Core Skill: Sort Students by Marks

SortingOnline Judge80 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Merit List Sorter

The Merit List Sorter manages structured campus records. Use structures, unions or files to sort student records according to marks in descending order.

🎯 Your Task

Sort student records according to marks in descending order.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use at most 100 records/items; check file operations before use.

Example Input
3
101 Ravi 70
102 Sita 90
103 Arun 80
Example Output
Sita 90
Arun 80
Ravi 70
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
SortingAdvanced80 Points
CHALLENGE 08Intermediate+

Nested Address Register

Core Skill: Nested Structure

StructuresOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Nested Address Register

The Nested Address Register manages structured campus records. Use structures, unions or files to create a student structure containing a nested address structure.

🎯 Your Task

Create a student structure containing a nested address structure.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use at most 100 records/items; check file operations before use.

Example Input
101
Ravi
Hyderabad
Example Output
101 Ravi Hyderabad
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StructuresIntermediate+70 Points
CHALLENGE 09Intermediate

Shared Memory Union Demo

Core Skill: Union Memory Concept

UnionsOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Shared Memory Union Demo

The Shared Memory Union Demo manages structured campus records. Use structures, unions or files to create a union containing an integer, float and character. Store one value and display it.

🎯 Your Task

Create a union containing an integer, float and character. store one value and display it.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use at most 100 records/items; check file operations before use.

Example Input
25
Example Output
25
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
UnionsIntermediate60 Points
CHALLENGE 10Intermediate

Record Vault Writer

Core Skill: Write Data to a File

File HandlingLocal File Lab60 Learning Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Record Vault Writer

The Record Vault Writer manages structured campus records. Use structures, unions or files to write a message into a text file.

🎯 Your Task

Write a message into a text file.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Produce the requested file/record result in the exact format shown.

📏 Constraints

Use at most 100 records/items; check file operations before use.

Example Input
Hello C
Example Output
Data written successfully
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
File HandlingIntermediate60 Learning Points
🖥️ Local File Lab

This challenge intentionally uses real files on disk. Practice it in your local C environment so fopen(), file creation, append/copy operations and persistent record behavior are genuine rather than simulated as standard input.

💡 Hint: Open the file using fopen() with write mode "w" .
Show Program
#include <stdio.h>

int main()
{
    FILE *fp;
    char str[100];

    fgets(str, sizeof(str), stdin);

    fp = fopen("data.txt", "w");

    if(fp == NULL)
    {
        printf("File Error");
        return 1;
    }

    fputs(str, fp);

    fclose(fp);

    printf("Data written successfully");

    return 0;
}
CHALLENGE 11Intermediate

Record Vault Reader

Core Skill: Read Data from a File

File HandlingLocal File Lab60 Learning Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Record Vault Reader

The Record Vault Reader manages structured campus records. Use structures, unions or files to accept and display the contents of a text file.

🎯 Your Task

Accept and display the contents of a text file.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Produce the requested file/record result in the exact format shown.

📏 Constraints

Use at most 100 records/items; check file operations before use.

Example Input
data.txt contains:
Hello C Programming
Example Output
Hello C Programming
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
File HandlingIntermediate60 Learning Points
🖥️ Local File Lab

This challenge intentionally uses real files on disk. Practice it in your local C environment so fopen(), file creation, append/copy operations and persistent record behavior are genuine rather than simulated as standard input.

💡 Hint: Open the file using "r" mode and use fgets() to read it.
Show Program
#include <stdio.h>

int main()
{
    FILE *fp;
    char str[200];

    fp = fopen("data.txt", "r");

    if(fp == NULL)
    {
        printf("File Not Found");
        return 1;
    }

    while(fgets(str, sizeof(str), fp) != NULL)
        printf("%s", str);

    fclose(fp);

    return 0;
}
CHALLENGE 12Intermediate

Archive Character Counter

Core Skill: Count Characters in a File

File HandlingLocal File Lab60 Learning Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Archive Character Counter

The Archive Character Counter manages structured campus records. Use structures, unions or files to count the number of characters stored in a text file.

🎯 Your Task

Count the number of characters stored in a text file.

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Produce the requested file/record result in the exact format shown.

📏 Constraints

Use at most 100 records/items; check file operations before use.

Example Input
data.txt:
Hello
Example Output
5
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
File HandlingIntermediate60 Learning Points
🖥️ Local File Lab

This challenge intentionally uses real files on disk. Practice it in your local C environment so fopen(), file creation, append/copy operations and persistent record behavior are genuine rather than simulated as standard input.

💡 Hint: Read one character at a time using fgetc() .
Show Program
#include <stdio.h>

int main()
{
    FILE *fp;
    int ch;
    int count = 0;

    fp = fopen("data.txt", "r");

    if(fp == NULL)
        return 1;

    while((ch = fgetc(fp)) != EOF)
        count++;

    fclose(fp);

    printf("%d", count);

    return 0;
}
CHALLENGE 13Intermediate

Archive Line Counter

Core Skill: Count Lines in a File

File HandlingLocal File Lab60 Learning Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Archive Line Counter

The Archive Line Counter manages structured campus records. Use structures, unions or files to count the number of lines in a text file.

🎯 Your Task

Count the number of lines in a text file.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Produce the requested file/record result in the exact format shown.

📏 Constraints

Use at most 100 records/items; check file operations before use.

Example Input
data.txt:
Line 1
Line 2
Line 3
Example Output
3
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
File HandlingIntermediate60 Learning Points
🖥️ Local File Lab

This challenge intentionally uses real files on disk. Practice it in your local C environment so fopen(), file creation, append/copy operations and persistent record behavior are genuine rather than simulated as standard input.

💡 Hint: Count newline characters. Also handle a final line that does not end with a newline.
Show Program
#include <stdio.h>

int main()
{
    FILE *fp;
    int ch;
    int lines = 0;
    int last = '\n';

    fp = fopen("data.txt", "r");

    if(fp == NULL)
        return 1;

    while((ch = fgetc(fp)) != EOF)
    {
        if(ch == '\n')
            lines++;

        last = ch;
    }

    if(last != '\n')
        lines++;

    fclose(fp);

    printf("%d", lines);

    return 0;
}
CHALLENGE 14Intermediate+

Archive Copy Desk

Core Skill: Copy One File to Another

File HandlingLocal File Lab70 Learning Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Archive Copy Desk

The Archive Copy Desk manages structured campus records. Use structures, unions or files to copy the contents of one file into another file.

🎯 Your Task

Copy the contents of one file into another file.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Produce the requested file/record result in the exact format shown.

📏 Constraints

Use at most 100 records/items; check file operations before use.

Example Input
source.txt:
Hello C
Example Output
destination.txt:
Hello C
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
File HandlingIntermediate+70 Learning Points
🖥️ Local File Lab

This challenge intentionally uses real files on disk. Practice it in your local C environment so fopen(), file creation, append/copy operations and persistent record behavior are genuine rather than simulated as standard input.

💡 Hint: Open the source in read mode and destination in write mode. Copy characters one by one.
Show Program
#include <stdio.h>

int main()
{
    FILE *source, *destination;
    int ch;

    source = fopen("source.txt", "r");
    destination = fopen("destination.txt", "w");

    if(source == NULL || destination == NULL)
        return 1;

    while((ch = fgetc(source)) != EOF)
        fputc(ch, destination);

    fclose(source);
    fclose(destination);

    printf("File copied successfully");

    return 0;
}
CHALLENGE 15Intermediate

Archive Append Desk

Core Skill: Append Data to a File

File HandlingLocal File Lab60 Learning Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Archive Append Desk

The Archive Append Desk manages structured campus records. Use structures, unions or files to add new text to the end of an existing file.

🎯 Your Task

Add new text to the end of an existing file.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Produce the requested file/record result in the exact format shown.

📏 Constraints

Use at most 100 records/items; check file operations before use.

Example Input
Welcome
Example Output
Data appended successfully
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
File HandlingIntermediate60 Learning Points
🖥️ Local File Lab

This challenge intentionally uses real files on disk. Practice it in your local C environment so fopen(), file creation, append/copy operations and persistent record behavior are genuine rather than simulated as standard input.

💡 Hint: Open the file using append mode "a" .
Show Program
#include <stdio.h>

int main()
{
    FILE *fp;
    char str[100];

    fgets(str, sizeof(str), stdin);

    fp = fopen("data.txt", "a");

    if(fp == NULL)
        return 1;

    fputs(str, fp);

    fclose(fp);

    printf("Data appended successfully");

    return 0;
}
CHALLENGE 16Intermediate+

Persistent Student Writer

Core Skill: Store Student Record in File

File HandlingLocal File Lab70 Learning Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Persistent Student Writer

The Persistent Student Writer manages structured campus records. Use structures, unions or files to store a student's roll number, name and marks in a file.

🎯 Your Task

Store a student's roll number, name and marks in a file.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Produce the requested file/record result in the exact format shown.

📏 Constraints

Use at most 100 records/items; check file operations before use.

Example Input
101 Ravi 85
Example Output
Student record saved
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
File HandlingIntermediate+70 Learning Points
🖥️ Local File Lab

This challenge intentionally uses real files on disk. Practice it in your local C environment so fopen(), file creation, append/copy operations and persistent record behavior are genuine rather than simulated as standard input.

💡 Hint: Use fprintf() to write formatted data into the file.
Show Program
#include <stdio.h>

int main()
{
    FILE *fp;
    int roll, marks;
    char name[50];

    scanf("%d %49s %d",
          &roll, name, &marks);

    fp = fopen("student.txt", "w");

    if(fp == NULL)
        return 1;

    fprintf(fp, "%d %s %d\n",
            roll, name, marks);

    fclose(fp);

    printf("Student record saved");

    return 0;
}
CHALLENGE 17Intermediate+

Persistent Student Reader

Core Skill: Read Student Record from File

File HandlingLocal File Lab70 Learning Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Persistent Student Reader

The Persistent Student Reader manages structured campus records. Use structures, unions or files to accept a student's record from a file and display it.

🎯 Your Task

Accept a student's record from a file and display it.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Produce the requested file/record result in the exact format shown.

📏 Constraints

Use at most 100 records/items; check file operations before use.

Example Input
student.txt:
101 Ravi 85
Example Output
101 Ravi 85
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
File HandlingIntermediate+70 Learning Points
🖥️ Local File Lab

This challenge intentionally uses real files on disk. Practice it in your local C environment so fopen(), file creation, append/copy operations and persistent record behavior are genuine rather than simulated as standard input.

💡 Hint: Use fscanf() to read formatted data.
Show Program
#include <stdio.h>

int main()
{
    FILE *fp;
    int roll, marks;
    char name[50];

    fp = fopen("student.txt", "r");

    if(fp == NULL)
        return 1;

    fscanf(fp, "%d %49s %d",
           &roll, name, &marks);

    printf("%d %s %d",
           roll, name, marks);

    fclose(fp);

    return 0;
}
CHALLENGE 18Intermediate+

Student File Counter

Core Skill: Count Students in File

File HandlingLocal File Lab70 Learning Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Student File Counter

The Student File Counter manages structured campus records. Use structures, unions or files to count the number of student records stored in a file.

🎯 Your Task

Count the number of student records stored in a file.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Produce the requested file/record result in the exact format shown.

📏 Constraints

Use at most 100 records/items; check file operations before use.

Example Input
student.txt:
101 Ravi 80
102 Sita 90
103 Arun 85
Example Output
3
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
File HandlingIntermediate+70 Learning Points
🖥️ Local File Lab

This challenge intentionally uses real files on disk. Practice it in your local C environment so fopen(), file creation, append/copy operations and persistent record behavior are genuine rather than simulated as standard input.

💡 Hint: Read one complete record at a time using fscanf() .
Show Program
#include <stdio.h>

int main()
{
    FILE *fp;
    int roll, marks;
    char name[50];
    int count = 0;

    fp = fopen("student.txt", "r");

    if(fp == NULL)
        return 1;

    while(fscanf(fp, "%d %49s %d",
                 &roll, name, &marks) == 3)
    {
        count++;
    }

    fclose(fp);

    printf("%d", count);

    return 0;
}
CHALLENGE 19Advanced

Binary Student Archive

Core Skill: Binary File Using Structure

File HandlingStructuresLocal File Lab80 Learning Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Binary Student Archive

The Binary Student Archive manages structured campus records. Use structures, unions or files to store a structure in a binary file using fwrite() .

🎯 Your Task

Store a structure in a binary file using fwrite() .

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Produce the requested file/record result in the exact format shown.

📏 Constraints

Use at most 100 records/items; check file operations before use.

Example Input
101 Ravi 85
Example Output
Record stored successfully
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
File HandlingStructuresAdvanced80 Learning Points
🖥️ Local File Lab

This challenge intentionally uses real files on disk. Practice it in your local C environment so fopen(), file creation, append/copy operations and persistent record behavior are genuine rather than simulated as standard input.

💡 Hint: Use fwrite() to write the entire structure into the binary file.
Show Program
#include <stdio.h>

struct Student
{
    int roll;
    char name[50];
    int marks;
};

int main()
{
    FILE *fp;
    struct Student s;

    scanf("%d %49s %d",
          &s.roll,
          s.name,
          &s.marks);

    fp = fopen("student.dat", "wb");

    if(fp == NULL)
        return 1;

    fwrite(&s, sizeof(s), 1, fp);

    fclose(fp);

    printf("Record stored successfully");

    return 0;
}
CHALLENGE 20Hard

Student Record Manager

Core Skill: Student Management Mini Project

StructuresLocal File Lab100 Learning Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Student Record Manager

The Student Record Manager manages structured campus records. Use structures, unions or files to create a menu-driven student management system using structures and file handling.

🎯 Your Task

Create a menu-driven student management system using structures and file handling.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Produce the requested file/record result in the exact format shown.

📏 Constraints

Use at most 100 records/items; check file operations before use.

Example Input
1
101
Ravi
85
Example Output
Student added successfully
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StructuresHard100 Learning Points
🖥️ Local File Lab

This challenge intentionally uses real files on disk. Practice it in your local C environment so fopen(), file creation, append/copy operations and persistent record behavior are genuine rather than simulated as standard input.

💡 Hint: Use a structure for student information, functions for each operation and a file to permanently store the records.
Show Program
#include <stdio.h>

struct Student
{
    int roll;
    char name[50];
    int marks;
};

void addStudent()
{
    FILE *fp;
    struct Student s;

    fp = fopen("students.dat", "ab");

    if(fp == NULL)
    {
        printf("File Error\n");
        return;
    }

    printf("Enter Roll Number: ");
    scanf("%d", &s.roll);

    printf("Enter Name: ");
    scanf("%49s", s.name);

    printf("Enter Marks: ");
    scanf("%d", &s.marks);

    fwrite(&s, sizeof(s), 1, fp);

    fclose(fp);

    printf("Student added successfully\n");
}

void displayStudents()
{
    FILE *fp;
    struct Student s;

    fp = fopen("students.dat", "rb");

    if(fp == NULL)
    {
        printf("No records found\n");
        return;
    }

    while(fread(&s, sizeof(s), 1, fp) == 1)
    {
        printf("Roll: %d\n", s.roll);
        printf("Name: %s\n", s.name);
        printf("Marks: %d\n\n", s.marks);
    }

    fclose(fp);
}

int main()
{
    int choice;

    do
    {
        printf("1. Add Student\n");
        printf("2. Display Students\n");
        printf("3. Exit\n");

        scanf("%d", &choice);

        switch(choice)
        {
            case 1:
                addStudent();
                break;

            case 2:
                displayStudents();
                break;

            case 3:
                printf("Exiting...");
                break;

            default:
                printf("Invalid choice\n");
        }

    } while(choice != 3);

    return 0;
}
📁Level 10 — Files & Runtime MemoryFile workflows combined with runtime-sized memory. • 20 original CodeBhavya challenges
Open 20 Challenges

Every challenge keeps the original C-learning objective from this level, while the story, framing and presentation are newly written for CodeBhavya.

CHALLENGE 01Intermediate

Daily Note Writer

Core Skill: Create and Write to a File

File HandlingLocal File Lab60 Learning Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Daily Note Writer

The Daily Note Writer handles persistent data or memory requested at runtime. Build the C workflow to create a file and write a message into it.

🎯 Your Task

Create a file and write a message into it.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Produce the requested file/record result in the exact format shown.

📏 Constraints

Use at most 100 records/items; check file and memory operations before use.

Example Input
Hello C Programming
Example Output
Data written successfully
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
File HandlingIntermediate60 Learning Points
🖥️ Local File Lab

This challenge intentionally uses real files on disk. Practice it in your local C environment so fopen(), file creation, append/copy operations and persistent record behavior are genuine rather than simulated as standard input.

💡 Hint: Use fopen() with "w" mode and fprintf() to write data.
Show Program
#include <stdio.h>


int main()
{
FILE *fp;
char str[100];


fgets(str, sizeof(str), stdin);

fp = fopen("data.txt", "w");

if(fp == NULL)
{
    printf("File cannot be opened");
    return 0;
}

fprintf(fp, "%s", str);

fclose(fp);

printf("Data written successfully");

return 0;

}
CHALLENGE 02Intermediate

Daily Note Reader

Core Skill: Read Data from a File

File HandlingLocal File Lab60 Learning Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Daily Note Reader

The Daily Note Reader handles persistent data or memory requested at runtime. Build the C workflow to accept and display the contents of a text file.

🎯 Your Task

Accept and display the contents of a text file.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Produce the requested file/record result in the exact format shown.

📏 Constraints

Use at most 100 records/items; check file and memory operations before use.

Example Input
data.txt contains:

Hello C
Example Output
Hello C
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
File HandlingIntermediate60 Learning Points
🖥️ Local File Lab

This challenge intentionally uses real files on disk. Practice it in your local C environment so fopen(), file creation, append/copy operations and persistent record behavior are genuine rather than simulated as standard input.

💡 Hint: Open the file using "r" mode and use fgets() to read the contents.
Show Program
#include <stdio.h>


int main()
{
FILE *fp;
char str[200];


fp = fopen("data.txt", "r");

if(fp == NULL)
{
    printf("File not found");
    return 0;
}

while(fgets(str, sizeof(str), fp) != NULL)
{
    printf("%s", str);
}

fclose(fp);

return 0;


}
CHALLENGE 03Intermediate

Archive Character Audit

Core Skill: Count Characters in a File

File HandlingLocal File Lab60 Learning Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Archive Character Audit

The Archive Character Audit handles persistent data or memory requested at runtime. Build the C workflow to count the number of characters present in a text file.

🎯 Your Task

Count the number of characters present in a text file.

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Produce the requested file/record result in the exact format shown.

📏 Constraints

Use at most 100 records/items; check file and memory operations before use.

Example Input
data.txt:


Hello
Example Output
5
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
File HandlingIntermediate60 Learning Points
🖥️ Local File Lab

This challenge intentionally uses real files on disk. Practice it in your local C environment so fopen(), file creation, append/copy operations and persistent record behavior are genuine rather than simulated as standard input.

💡 Hint: Read the file character by character using fgetc() and increment a counter.
Show Program
#include <stdio.h>


int main()
{
FILE *fp;
int ch;
int count = 0;


fp = fopen("data.txt", "r");

if(fp == NULL)
{
    printf("File not found");
    return 0;
}

while((ch = fgetc(fp)) != EOF)
{
    count++;
}

fclose(fp);

printf("%d", count);

return 0;


}
CHALLENGE 04Intermediate

Archive Line Audit

Core Skill: Count Lines in a File

File HandlingLocal File Lab60 Learning Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Archive Line Audit

The Archive Line Audit handles persistent data or memory requested at runtime. Build the C workflow to count the number of lines present in a text file.

🎯 Your Task

Count the number of lines present in a text file.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Produce the requested file/record result in the exact format shown.

📏 Constraints

Use at most 100 records/items; check file and memory operations before use.

Example Input
data.txt:


Hello
World
C Programming
Example Output
3
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
File HandlingIntermediate60 Learning Points
🖥️ Local File Lab

This challenge intentionally uses real files on disk. Practice it in your local C environment so fopen(), file creation, append/copy operations and persistent record behavior are genuine rather than simulated as standard input.

💡 Hint: Count every newline character. Also handle a file whose final line does not end with a newline.
Show Program
#include <stdio.h>


int main()
{
FILE *fp;
int ch;
int lines = 0;
int last = '\n';


fp = fopen("data.txt", "r");

if(fp == NULL)
{
    printf("File not found");
    return 0;
}

while((ch = fgetc(fp)) != EOF)
{
    if(ch == '\n')
        lines++;

    last = ch;
}

if(last != '\n')
    lines++;

fclose(fp);

printf("%d", lines);

return 0;


}
CHALLENGE 05Intermediate+

Archive Word Audit

Core Skill: Count Words in a File

File HandlingLocal File Lab70 Learning Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Archive Word Audit

The Archive Word Audit handles persistent data or memory requested at runtime. Build the C workflow to count the number of words present in a text file.

🎯 Your Task

Count the number of words present in a text file.

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Produce the requested file/record result in the exact format shown.

📏 Constraints

Use at most 100 records/items; check file and memory operations before use.

Example Input
data.txt:

C programming is easy
Example Output
4
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
File HandlingIntermediate+70 Learning Points
🖥️ Local File Lab

This challenge intentionally uses real files on disk. Practice it in your local C environment so fopen(), file creation, append/copy operations and persistent record behavior are genuine rather than simulated as standard input.

💡 Hint: Track whether you are currently inside a word. Use whitespace to identify word boundaries.
Show Program
#include <stdio.h>



int main()
{
FILE *fp;
int ch;
int words = 0;
int inWord = 0;

fp = fopen("data.txt", "r");

if(fp == NULL)
{
    printf("File not found");
    return 0;
}

while((ch = fgetc(fp)) != EOF)
{
    if(isspace(ch))
    {
        inWord = 0;
    }
    else if(!inWord)
    {
        words++;
        inWord = 1;
    }
}

fclose(fp);

printf("%d", words);

return 0;

}
CHALLENGE 06Intermediate+

Vault Copy Service

Core Skill: Copy One File to Another

File HandlingLocal File Lab70 Learning Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Vault Copy Service

The Vault Copy Service handles persistent data or memory requested at runtime. Build the C workflow to copy the contents of one text file into another file.

🎯 Your Task

Copy the contents of one text file into another file.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Produce the requested file/record result in the exact format shown.

📏 Constraints

Use at most 100 records/items; check file and memory operations before use.

Example Input
source.txt:

Hello C Programming
Example Output
Data copied successfully
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
File HandlingIntermediate+70 Learning Points
🖥️ Local File Lab

This challenge intentionally uses real files on disk. Practice it in your local C environment so fopen(), file creation, append/copy operations and persistent record behavior are genuine rather than simulated as standard input.

💡 Hint: Open the source file in read mode and destination file in write mode. Copy characters using fgetc() and fputc().
Show Program
#include <stdio.h>

int main()
{
FILE *source;
FILE *destination;

int ch;

source = fopen("source.txt", "r");

if(source == NULL)
{
    printf("Source file not found");
    return 0;
}

destination = fopen("copy.txt", "w");

if(destination == NULL)
{
    fclose(source);
    printf("Destination file cannot be opened");
    return 0;
}

while((ch = fgetc(source)) != EOF)
{
    fputc(ch, destination);
}

fclose(source);
fclose(destination);

printf("Data copied successfully");

return 0;

}
CHALLENGE 07Intermediate

Vault Append Service

Core Skill: Append Data to a File

File HandlingLocal File Lab60 Learning Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Vault Append Service

The Vault Append Service handles persistent data or memory requested at runtime. Build the C workflow to add new text to the end of an existing file without deleting its old contents.

🎯 Your Task

Add new text to the end of an existing file without deleting its old contents.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Produce the requested file/record result in the exact format shown.

📏 Constraints

Use at most 100 records/items; check file and memory operations before use.

Example Input
data.txt:

Hello

New input:
World
Example Output
Hello

World
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
File HandlingIntermediate60 Learning Points
🖥️ Local File Lab

This challenge intentionally uses real files on disk. Practice it in your local C environment so fopen(), file creation, append/copy operations and persistent record behavior are genuine rather than simulated as standard input.

💡 Hint: Open the file using "a" mode.
Show Program
#include <stdio.h>

int main()
{
FILE *fp;
char str[100];

fgets(str, sizeof(str), stdin);

fp = fopen("data.txt", "a");

if(fp == NULL)
{
    printf("File cannot be opened");
    return 0;
}

fprintf(fp, "%s", str);

fclose(fp);

printf("Data appended successfully");

return 0;

}
CHALLENGE 08Intermediate+

Archive Keyword Finder

Core Skill: Search for a Word in a File

File HandlingSearchingLocal File Lab70 Learning Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Archive Keyword Finder

The Archive Keyword Finder handles persistent data or memory requested at runtime. Build the C workflow to search whether a given word is present in a text file.

🎯 Your Task

Search whether a given word is present in a text file.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Produce the requested file/record result in the exact format shown.

📏 Constraints

Use at most 100 records/items; check file and memory operations before use.

Example Input
data.txt:

C programming is powerful

Search:
programming
Example Output
Found
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
File HandlingSearchingIntermediate+70 Learning Points
🖥️ Local File Lab

This challenge intentionally uses real files on disk. Practice it in your local C environment so fopen(), file creation, append/copy operations and persistent record behavior are genuine rather than simulated as standard input.

💡 Hint: Read words using fscanf() and compare each word with the search word using strcmp().
Show Program
#include <stdio.h>
#include <string.h>



int main()
{
FILE *fp;
char word[100];
char search[100];

fp = fopen("data.txt", "r");

if(fp == NULL)
{
    printf("File not found");
    return 0;
}

scanf("%99s", search);

while(fscanf(fp, "%99s", word) == 1)
{
    if(strcmp(word, search) == 0)
    {
        printf("Found");
        fclose(fp);
        return 0;
    }
}

fclose(fp);

printf("Not Found");

return 0;

}
CHALLENGE 09Intermediate

Archive Character Finder

Core Skill: Count a Character in a File

File HandlingLocal File Lab60 Learning Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Archive Character Finder

The Archive Character Finder handles persistent data or memory requested at runtime. Build the C workflow to count how many times a given character occurs in a text file.

🎯 Your Task

Count how many times a given character occurs in a text file.

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Produce the requested file/record result in the exact format shown.

📏 Constraints

Use at most 100 records/items; check file and memory operations before use.

Example Input
data.txt:
        
programming

Search:
g
Example Output
2
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
File HandlingIntermediate60 Learning Points
🖥️ Local File Lab

This challenge intentionally uses real files on disk. Practice it in your local C environment so fopen(), file creation, append/copy operations and persistent record behavior are genuine rather than simulated as standard input.

💡 Hint: Read each character using fgetc() and compare it with the requested character.
Show Program
#include <stdio.h>

int main()
{
FILE *fp;
int ch;
char search;
int count = 0;

fp = fopen("data.txt", "r");

if(fp == NULL)
{
    printf("File not found");
    return 0;
}

scanf(" %c", &search);

while((ch = fgetc(fp)) != EOF)
{
    if(ch == search)
        count++;
}

fclose(fp);

printf("%d", count);

return 0;

}
CHALLENGE 10Intermediate+

Number Archive Writer

Core Skill: Store Numbers in a File

File HandlingLocal File Lab70 Learning Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Number Archive Writer

The Number Archive Writer handles persistent data or memory requested at runtime. Build the C workflow to accept N integers and store them in a file.

🎯 Your Task

Accept n integers and store them in a file.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Produce the requested file/record result in the exact format shown.

📏 Constraints

Use at most 100 records/items; check file and memory operations before use.

Example Input
5

10 20 30 40 50
Example Output
Numbers stored successfully
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
File HandlingIntermediate+70 Learning Points
🖥️ Local File Lab

This challenge intentionally uses real files on disk. Practice it in your local C environment so fopen(), file creation, append/copy operations and persistent record behavior are genuine rather than simulated as standard input.

💡 Hint: Open a file in write mode and use fprintf() to store each number.
Show Program
#include <stdio.h>

int main()
{
FILE *fp;
int n, x;

scanf("%d", &n);

fp = fopen("numbers.txt", "w");

if(fp == NULL)
{
    printf("File cannot be opened");
    return 0;
}

for(int i = 0; i < n; i++)
{
    scanf("%d", &x);
    fprintf(fp, "%d ", x);
}

fclose(fp);

printf("Numbers stored successfully");

return 0;

}
CHALLENGE 11Intermediate+

Number Archive Sum Desk

Core Skill: Read Numbers from a File and Find Sum

File HandlingLocal File Lab70 Learning Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Number Archive Sum Desk

The Number Archive Sum Desk handles persistent data or memory requested at runtime. Build the C workflow to accept integers from a file and calculate their sum.

🎯 Your Task

Accept integers from a file and calculate their sum.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Produce the requested file/record result in the exact format shown.

📏 Constraints

Use at most 100 records/items; check file and memory operations before use.

Example Input
numbers.txt:

10 20 30 40 50
Example Output
150
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
File HandlingIntermediate+70 Learning Points
🖥️ Local File Lab

This challenge intentionally uses real files on disk. Practice it in your local C environment so fopen(), file creation, append/copy operations and persistent record behavior are genuine rather than simulated as standard input.

💡 Hint: Use fscanf() to read integers until EOF.
Show Program
#include <stdio.h>

int main()
{
FILE *fp;
int x;
int sum = 0;

fp = fopen("numbers.txt", "r");

if(fp == NULL)
{
    printf("File not found");
    return 0;
}

while(fscanf(fp, "%d", &x) == 1)
{
    sum += x;
}

fclose(fp);

printf("%d", sum);

return 0;

}
CHALLENGE 12Intermediate

Runtime Integer Slot

Core Skill: Allocate Memory Using malloc()

File / MemoryOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Runtime Integer Slot

The Runtime Integer Slot handles persistent data or memory requested at runtime. Build the C workflow to dynamically allocate memory for N integers using malloc() and print them.

🎯 Your Task

Dynamically allocate memory for n integers using malloc() and print them.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use at most 100 records/items; check file and memory operations before use.

Example Input
5

10 20 30 40 50
Example Output
10 20 30 40 50
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
File / MemoryIntermediate60 Points
CHALLENGE 13Intermediate+

Runtime Array Sum

Core Skill: Sum of Dynamically Allocated Array

ArraysDynamic MemoryOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Runtime Array Sum

The Runtime Array Sum handles persistent data or memory requested at runtime. Build the C workflow to dynamically allocate an integer array and find the sum of its elements.

🎯 Your Task

Dynamically allocate an integer array and find the sum of its elements.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use at most 100 records/items; check file and memory operations before use.

Example Input
5

10 20 30 40 50
Example Output
150
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysDynamic MemoryIntermediate+70 Points
CHALLENGE 14Intermediate

Zeroed Runtime Array

Core Skill: Allocate Memory Using calloc()

File / MemoryOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Zeroed Runtime Array

The Zeroed Runtime Array handles persistent data or memory requested at runtime. Build the C workflow to allocate memory for N integers using calloc() and display the initial values.

🎯 Your Task

Allocate memory for n integers using calloc() and display the initial values.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use at most 100 records/items; check file and memory operations before use.

Example Input
5
Example Output
0 0 0 0 0
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
File / MemoryIntermediate60 Points
CHALLENGE 15Intermediate+

Expandable Runtime Array

Core Skill: Resize Memory Using realloc()

File / MemoryOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Expandable Runtime Array

The Expandable Runtime Array handles persistent data or memory requested at runtime. Build the C workflow to allocate memory for N integers and increase the array size to M using realloc() .

🎯 Your Task

Allocate memory for n integers and increase the array size to m using realloc() .

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use at most 100 records/items; check file and memory operations before use.

Example Input
3

10 20 30
5
40 50
Example Output
10 20 30 40 50
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
File / MemoryIntermediate+70 Points
CHALLENGE 16Intermediate+

Runtime Maximum Finder

Core Skill: Find Largest Element Using Dynamic Memory

Dynamic MemoryComparisonOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Runtime Maximum Finder

The Runtime Maximum Finder handles persistent data or memory requested at runtime. Build the C workflow to dynamically allocate an array and find its largest element.

🎯 Your Task

Dynamically allocate an array and find its largest element.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use at most 100 records/items; check file and memory operations before use.

Example Input
5

10 45 20 67 30
Example Output
67
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Dynamic MemoryComparisonIntermediate+70 Points
CHALLENGE 17Advanced

Runtime Array Reversal

Core Skill: Reverse Dynamically Allocated Array

ArraysDynamic MemoryOnline Judge80 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Runtime Array Reversal

The Runtime Array Reversal handles persistent data or memory requested at runtime. Build the C workflow to dynamically allocate an array and reverse its elements.

🎯 Your Task

Dynamically allocate an array and reverse its elements.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use at most 100 records/items; check file and memory operations before use.

Example Input
5

10 20 30 40 50
Example Output
50 40 30 20 10
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysDynamic MemoryAdvanced80 Points
CHALLENGE 18Intermediate+

Runtime Text Buffer

Core Skill: Dynamically Allocate a String

StringsDynamic MemoryOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Runtime Text Buffer

The Runtime Text Buffer handles persistent data or memory requested at runtime. Build the C workflow to dynamically allocate memory for a string and display the entered string.

🎯 Your Task

Dynamically allocate memory for a string and display the entered string.

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use at most 100 records/items; check file and memory operations before use.

Example Input
Programming
Example Output
Programming
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StringsDynamic MemoryIntermediate+70 Points
CHALLENGE 19Advanced

Runtime Student Registry

Core Skill: Dynamic Memory with Structure

Dynamic MemoryStructuresOnline Judge80 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Runtime Student Registry

The Runtime Student Registry handles persistent data or memory requested at runtime. Build the C workflow to dynamically allocate memory for N students using structures and display their details.

🎯 Your Task

Dynamically allocate memory for n students using structures and display their details.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use at most 100 records/items; check file and memory operations before use.

Example Input
2

Ravi 85
Sita 92
Example Output
Ravi 85
Sita 92
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Dynamic MemoryStructuresAdvanced80 Points
CHALLENGE 20Hard

Persistent Dynamic Student Vault

Core Skill: Student Records Using File and Dynamic Memory

Dynamic MemoryFile HandlingLocal File Lab100 Learning Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Persistent Dynamic Student Vault

The Persistent Dynamic Student Vault handles persistent data or memory requested at runtime. Build the C workflow to dynamically allocate memory for student records, store them in a file and then read and display them.

🎯 Your Task

Dynamically allocate memory for student records, store them in a file and then read and display them.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Produce the requested file/record result in the exact format shown.

📏 Constraints

Use at most 100 records/items; check file and memory operations before use.

Example Input
2


Ravi 85
Sita 92
Example Output
Ravi 85


Sita 92
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Dynamic MemoryFile HandlingHard100 Learning Points
🖥️ Local File Lab

This challenge intentionally uses real files on disk. Practice it in your local C environment so fopen(), file creation, append/copy operations and persistent record behavior are genuine rather than simulated as standard input.

💡 Hint: Allocate the student array using malloc(). Write the records using fprintf(), then reopen the file and read them using fscanf().
Show Program
#include <stdio.h>
#include <stdlib.h>




struct Student
{
char name[50];
int marks;
};

int main()
{
int n;

scanf("%d", &n);

struct Student *s =
    malloc(n * sizeof(struct Student));

if(s == NULL)
    return 0;

for(int i = 0; i < n; i++)
{
    scanf("%49s %d",
          s[i].name,
          &s[i].marks);
}

FILE *fp = fopen("students.txt", "w");

if(fp == NULL)
{
    free(s);
    return 0;
}

for(int i = 0; i < n; i++)
{
    fprintf(fp, "%s %d\n",
            s[i].name,
            s[i].marks);
}

fclose(fp);

free(s);

fp = fopen("students.txt", "r");

if(fp == NULL)
    return 0;

struct Student temp;

while(fscanf(fp, "%49s %d",
             temp.name,
             &temp.marks) == 2)
{
    printf("%s %d\n",
           temp.name,
           temp.marks);
}

fclose(fp);

return 0;


}
💻Level 11 — Terminal & BitwiseCommand-line utilities and compact bit-level operations. • 20 original CodeBhavya challenges
Open 20 Challenges

Every challenge keeps the original C-learning objective from this level, while the story, framing and presentation are newly written for CodeBhavya.

CHALLENGE 01Moderate

Terminal Greeting Tool

Core Skill: Read Command Line Argument

Command LineOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Terminal Greeting Tool

The Terminal Greeting Tool is a systems-style utility. Implement the command-line or bitwise operation needed to accept and display a command line argument.

🎯 Your Task

Accept and display a command line argument.

📥 Input Format

Supply the required values as command-line arguments after the executable name.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Assume the required argument count is provided unless the challenge asks you to validate it.

Example Input
./program Venu
Example Output
Venu
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Command LineModerate50 Points
CHALLENGE 02Moderate

Terminal Argument Meter

Core Skill: Count Command Line Arguments

Command LineOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Terminal Argument Meter

The Terminal Argument Meter is a systems-style utility. Implement the command-line or bitwise operation needed to count the number of arguments supplied through the command line.

🎯 Your Task

Count the number of arguments supplied through the command line.

📥 Input Format

Supply the required values as command-line arguments after the executable name.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Assume the required argument count is provided unless the challenge asks you to validate it.

Example Input
./program C Java Python
Example Output
3
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Command LineModerate50 Points
CHALLENGE 03Intermediate

Terminal Sum Utility

Core Skill: Add Two Command Line Numbers

Command LineOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Terminal Sum Utility

The Terminal Sum Utility is a systems-style utility. Implement the command-line or bitwise operation needed to accept two integers through command line arguments and print their sum.

🎯 Your Task

Accept two integers through command line arguments and print their sum.

📥 Input Format

Supply the required values as command-line arguments after the executable name.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Assume the required argument count is provided unless the challenge asks you to validate it.

Example Input
./program 10 20
Example Output
30
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Command LineIntermediate60 Points
CHALLENGE 04Intermediate+

Terminal Maximum Utility

Core Skill: Find Largest Command Line Number

Command LineComparisonOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Terminal Maximum Utility

The Terminal Maximum Utility is a systems-style utility. Implement the command-line or bitwise operation needed to accept three integers through command line arguments and find the largest number.

🎯 Your Task

Accept three integers through command line arguments and find the largest number.

📥 Input Format

Supply the required values as command-line arguments after the executable name.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Assume the required argument count is provided unless the challenge asks you to validate it.

Example Input
./program 25 10 40
Example Output
40
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Command LineComparisonIntermediate+70 Points
CHALLENGE 05Easy+

Permission AND Console

Core Skill: Bitwise AND

BitwiseOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Permission AND Console

The Permission AND Console is a systems-style utility. Implement the command-line or bitwise operation needed to perform bitwise AND operation on two integers.

🎯 Your Task

Perform bitwise and operation on two integers.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use non-negative 32-bit integer values unless a specific bit width is stated.

Example Input
12 10
Example Output
8
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
BitwiseEasy+40 Points
CHALLENGE 06Easy+

Feature OR Console

Core Skill: Bitwise OR

BitwiseOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Feature OR Console

The Feature OR Console is a systems-style utility. Implement the command-line or bitwise operation needed to perform bitwise OR operation on two integers.

🎯 Your Task

Perform bitwise or operation on two integers.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use non-negative 32-bit integer values unless a specific bit width is stated.

Example Input
12 10
Example Output
14
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
BitwiseEasy+40 Points
CHALLENGE 07Easy+

Toggle XOR Console

Core Skill: Bitwise XOR

BitwiseOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Toggle XOR Console

The Toggle XOR Console is a systems-style utility. Implement the command-line or bitwise operation needed to perform bitwise XOR operation on two integers.

🎯 Your Task

Perform bitwise xor operation on two integers.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use non-negative 32-bit integer values unless a specific bit width is stated.

Example Input
12 10
Example Output
6
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
BitwiseEasy+40 Points
CHALLENGE 08Easy+

Bit Inversion Panel

Core Skill: Bitwise NOT

BitwiseOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Bit Inversion Panel

The Bit Inversion Panel is a systems-style utility. Implement the command-line or bitwise operation needed to determine the bitwise NOT of a given integer.

🎯 Your Task

Determine the bitwise not of a given integer.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use non-negative 32-bit integer values unless a specific bit width is stated.

Example Input
5
Example Output
-6
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
BitwiseEasy+40 Points
CHALLENGE 09Easy+

Fast Multiply Shift Panel

Core Skill: Left Shift

BitwiseOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Fast Multiply Shift Panel

The Fast Multiply Shift Panel is a systems-style utility. Implement the command-line or bitwise operation needed to perform a left shift operation on an integer.

🎯 Your Task

Perform a left shift operation on an integer.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use non-negative 32-bit integer values unless a specific bit width is stated.

Example Input
5 2
Example Output
20
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
BitwiseEasy+40 Points
CHALLENGE 10Easy+

Fast Divide Shift Panel

Core Skill: Right Shift

BitwiseOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Fast Divide Shift Panel

The Fast Divide Shift Panel is a systems-style utility. Implement the command-line or bitwise operation needed to perform a right shift operation on an integer.

🎯 Your Task

Perform a right shift operation on an integer.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use non-negative 32-bit integer values unless a specific bit width is stated.

Example Input
20 2
Example Output
5
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
BitwiseEasy+40 Points
CHALLENGE 11Easy+

Parity Bit Scanner

Core Skill: Check Whether a Number is Even Using Bitwise

BitwiseOnline Judge40 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Parity Bit Scanner

The Parity Bit Scanner is a systems-style utility. Implement the command-line or bitwise operation needed to determine whether a number is even or odd using a bitwise operator.

🎯 Your Task

Determine whether a number is even or odd using a bitwise operator.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use non-negative 32-bit integer values unless a specific bit width is stated.

Example Input
18
Example Output
Even
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
BitwiseEasy+40 Points
CHALLENGE 12Moderate

Specific Bit Inspector

Core Skill: Check a Specific Bit

BitwiseOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Specific Bit Inspector

The Specific Bit Inspector is a systems-style utility. Implement the command-line or bitwise operation needed to determine whether the K-th bit of a number is set. Consider the least significant bit as bit 0.

🎯 Your Task

Determine whether the k-th bit of a number is set. consider the least significant bit as bit 0.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use non-negative 32-bit integer values unless a specific bit width is stated.

Example Input
10 1
Example Output
Set
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
BitwiseModerate50 Points
CHALLENGE 13Moderate

Permission Bit Setter

Core Skill: Set the K-th Bit

BitwiseOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Permission Bit Setter

The Permission Bit Setter is a systems-style utility. Implement the command-line or bitwise operation needed to set the K-th bit of a number to 1.

🎯 Your Task

Set the k-th bit of a number to 1.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use non-negative 32-bit integer values unless a specific bit width is stated.

Example Input
8 1
Example Output
10
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
BitwiseModerate50 Points
CHALLENGE 14Moderate

Permission Bit Cleaner

Core Skill: Clear the K-th Bit

BitwiseOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Permission Bit Cleaner

The Permission Bit Cleaner is a systems-style utility. Implement the command-line or bitwise operation needed to clear the K-th bit of a number.

🎯 Your Task

Clear the k-th bit of a number.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use non-negative 32-bit integer values unless a specific bit width is stated.

Example Input
10 1
Example Output
8
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
BitwiseModerate50 Points
CHALLENGE 15Moderate

Permission Bit Toggle

Core Skill: Toggle the K-th Bit

BitwiseOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Permission Bit Toggle

The Permission Bit Toggle is a systems-style utility. Implement the command-line or bitwise operation needed to toggle the K-th bit of a number.

🎯 Your Task

Toggle the k-th bit of a number.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use non-negative 32-bit integer values unless a specific bit width is stated.

Example Input
10 1
Example Output
8
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
BitwiseModerate50 Points
CHALLENGE 16Intermediate+

Active Flag Counter

Core Skill: Count Set Bits

BitwiseOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Active Flag Counter

The Active Flag Counter is a systems-style utility. Implement the command-line or bitwise operation needed to count the number of 1 bits in the binary representation of a positive integer.

🎯 Your Task

Count the number of 1 bits in the binary representation of a positive integer.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use non-negative 32-bit integer values unless a specific bit width is stated.

Example Input
13
Example Output
3
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
BitwiseIntermediate+70 Points
CHALLENGE 17Intermediate

Single-Flag Power Check

Core Skill: Check Power of Two

Systems COnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Single-Flag Power Check

The Single-Flag Power Check is a systems-style utility. Implement the command-line or bitwise operation needed to determine whether a positive integer is a power of 2 using bitwise operations.

🎯 Your Task

Determine whether a positive integer is a power of 2 using bitwise operations.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use non-negative 32-bit integer values unless a specific bit width is stated.

Example Input
16
Example Output
Power of 2
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Systems CIntermediate60 Points
CHALLENGE 18Intermediate+

Unique Device ID Finder

Core Skill: Find the Unique Element

Systems COnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Unique Device ID Finder

The Unique Device ID Finder is a systems-style utility. Implement the command-line or bitwise operation needed to every element in an array appears twice except one. Find the element that appears only once.

🎯 Your Task

Every element in an array appears twice except one. find the element that appears only once.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use values appropriate to the command-line or bitwise operation.

Example Input
5


4 1 2 1 2
Example Output
4
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Systems CIntermediate+70 Points
CHALLENGE 19Intermediate

XOR Swap Console

Core Skill: Swap Two Numbers Using XOR

BitwiseOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

XOR Swap Console

The XOR Swap Console is a systems-style utility. Implement the command-line or bitwise operation needed to swap two integer values without using a third variable, using XOR.

🎯 Your Task

Swap two integer values without using a third variable, using xor.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use non-negative 32-bit integer values unless a specific bit width is stated.

Example Input
10 20
Example Output
20 10
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
BitwiseIntermediate60 Points
CHALLENGE 20Advanced

Eight-Bit Mirror Panel

Core Skill: Reverse Bits of an 8-bit Number

BitwiseOnline Judge80 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Eight-Bit Mirror Panel

The Eight-Bit Mirror Panel is a systems-style utility. Implement the command-line or bitwise operation needed to reverse the bits of an 8-bit unsigned number.

🎯 Your Task

Reverse the bits of an 8-bit unsigned number.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use non-negative 32-bit integer values unless a specific bit width is stated.

Example Input
13
Example Output
176
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
BitwiseAdvanced80 Points
🏆Level 12 — Placement SprintInterview-style algorithmic challenges with clear competitive statements. • 20 original CodeBhavya challenges
Open 20 Challenges

Every challenge keeps the original C-learning objective from this level, while the story, framing and presentation are newly written for CodeBhavya.

CHALLENGE 01Intermediate+

Runner-Up Package Board

Core Skill: Second Largest Element

ComparisonOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Runner-Up Package Board

During the CodeBhavya Placement Sprint, the Runner-Up Package Board challenge tests careful problem solving. Implement a reliable solution to determine the second largest element in an array without sorting it.

🎯 Your Task

Determine the second largest element in an array without sorting it.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 1000 for array challenges; values fit in a 32-bit signed integer unless stated.

Example Input
6

10 25 8 40 15 30
Example Output
30
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ComparisonIntermediate+70 Points
CHALLENGE 02Intermediate+

Candidate ID Deduplicator

Core Skill: Remove Duplicates from Array

ArraysDuplicate HandlingOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Candidate ID Deduplicator

During the CodeBhavya Placement Sprint, the Candidate ID Deduplicator challenge tests careful problem solving. Implement a reliable solution to remove duplicate elements from an array and print only the unique elements.

🎯 Your Task

Remove duplicate elements from an array and print only the unique elements.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 1000 for array challenges; values fit in a 32-bit signed integer unless stated.

Example Input
7

10 20 10 30 20 40 30
Example Output
10 20 30 40
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysDuplicate HandlingIntermediate+70 Points
CHALLENGE 03Intermediate+

Vacant Seat Compactor

Core Skill: Move All Zeros to End

Problem SolvingOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Vacant Seat Compactor

During the CodeBhavya Placement Sprint, the Vacant Seat Compactor challenge tests careful problem solving. Implement a reliable solution to move all zero elements to the end while maintaining the order of non-zero elements.

🎯 Your Task

Move all zero elements to the end while maintaining the order of non-zero elements.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 1000 for array challenges; values fit in a 32-bit signed integer unless stated.

Example Input
7


0 1 0 3 12 0 5
Example Output
1 3 12 5 0 0 0
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Problem SolvingIntermediate+70 Points
CHALLENGE 04Intermediate+

Missing Registration ID

Core Skill: Find Missing Number

Problem SolvingOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Missing Registration ID

During the CodeBhavya Placement Sprint, the Missing Registration ID challenge tests careful problem solving. Implement a reliable solution to an array contains numbers from 1 to N with one number missing. Find the missing number.

🎯 Your Task

An array contains numbers from 1 to n with one number missing. find the missing number.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 1000 for array challenges; values fit in a 32-bit signed integer unless stated.

Example Input
5

1 2 4 5
Example Output
3
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Problem SolvingIntermediate+70 Points
CHALLENGE 05Hard

Best Streak Score

Core Skill: Maximum Subarray Sum

ArraysComparisonOnline Judge100 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Best Streak Score

During the CodeBhavya Placement Sprint, the Best Streak Score challenge tests careful problem solving. Implement a reliable solution to determine the maximum possible sum of a contiguous subarray.

🎯 Your Task

Determine the maximum possible sum of a contiguous subarray.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 1000 for array challenges; values fit in a 32-bit signed integer unless stated.

Example Input
8

-2 1 -3 4 -1 2 1 -5
Example Output
6
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysComparisonHard100 Points
CHALLENGE 06Advanced

Circular Shift Roster

Core Skill: Rotate Array Right by K Positions

ArraysArray RotationOnline Judge80 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Circular Shift Roster

During the CodeBhavya Placement Sprint, the Circular Shift Roster challenge tests careful problem solving. Implement a reliable solution to rotate an array to the right by K positions.

🎯 Your Task

Rotate an array to the right by k positions.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 1000 for array challenges; values fit in a 32-bit signed integer unless stated.

Example Input
5 2

1 2 3 4 5
Example Output
4 5 1 2 3
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysArray RotationAdvanced80 Points
CHALLENGE 07Advanced

Unique Badge Character

Core Skill: First Non-Repeating Character

Problem SolvingOnline Judge80 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Unique Badge Character

During the CodeBhavya Placement Sprint, the Unique Badge Character challenge tests careful problem solving. Implement a reliable solution to determine the first character that appears only once in a string.

🎯 Your Task

Determine the first character that appears only once in a string.

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 1000 for array challenges; values fit in a 32-bit signed integer unless stated.

Example Input
swiss
Example Output
w
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Problem SolvingAdvanced80 Points
CHALLENGE 08Intermediate+

Team Code Anagram Check

Core Skill: Check Anagram

Character FrequencyOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Team Code Anagram Check

During the CodeBhavya Placement Sprint, the Team Code Anagram Check challenge tests careful problem solving. Implement a reliable solution to determine whether two strings are anagrams of each other.

🎯 Your Task

Determine whether two strings are anagrams of each other.

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 1000 for array challenges; values fit in a 32-bit signed integer unless stated.

Example Input
listen

silent
Example Output
Anagram
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Character FrequencyIntermediate+70 Points
CHALLENGE 09Advanced+

Notice Word Reversal

Core Skill: Reverse Words in a String

StringsOnline Judge90 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Notice Word Reversal

During the CodeBhavya Placement Sprint, the Notice Word Reversal challenge tests careful problem solving. Implement a reliable solution to reverse the order of words in a sentence.

🎯 Your Task

Reverse the order of words in a sentence.

📥 Input Format

Read the required string, sentence or character data exactly as described.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 1000 for array challenges; values fit in a 32-bit signed integer unless stated.

Example Input
C is powerful
Example Output
powerful is C
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
StringsAdvanced+90 Points
CHALLENGE 10Moderate

Mirror Candidate Number

Core Skill: Check Palindrome Number

PalindromeOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Mirror Candidate Number

During the CodeBhavya Placement Sprint, the Mirror Candidate Number challenge tests careful problem solving. Implement a reliable solution to determine whether a number is a palindrome.

🎯 Your Task

Determine whether a number is a palindrome.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 1000 for array challenges; values fit in a 32-bit signed integer unless stated.

Example Input
1221
Example Output
Palindrome
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
PalindromeModerate50 Points
CHALLENGE 11Intermediate

Cube-Sum ID Check

Core Skill: Armstrong Number

Problem SolvingOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Cube-Sum ID Check

During the CodeBhavya Placement Sprint, the Cube-Sum ID Check challenge tests careful problem solving. Implement a reliable solution to determine whether a three-digit number is an Armstrong number.

🎯 Your Task

Determine whether a three-digit number is an armstrong number.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 1000 for array challenges; values fit in a 32-bit signed integer unless stated.

Example Input
153
Example Output
Armstrong
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Problem SolvingIntermediate60 Points
CHALLENGE 12Intermediate+

Prime Screening Window

Core Skill: Prime Numbers in a Range

Number TheoryOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Prime Screening Window

During the CodeBhavya Placement Sprint, the Prime Screening Window challenge tests careful problem solving. Implement a reliable solution to produce all prime numbers between L and R.

🎯 Your Task

Produce all prime numbers between l and r.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 1000 for array challenges; values fit in a 32-bit signed integer unless stated.

Example Input
10 20
Example Output
11 13 17 19
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Number TheoryIntermediate+70 Points
CHALLENGE 13Moderate

Interview GCD Utility

Core Skill: GCD of Two Numbers

Number TheoryOnline Judge50 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Interview GCD Utility

During the CodeBhavya Placement Sprint, the Interview GCD Utility challenge tests careful problem solving. Implement a reliable solution to determine the greatest common divisor of two integers.

🎯 Your Task

Determine the greatest common divisor of two integers.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 1000 for array challenges; values fit in a 32-bit signed integer unless stated.

Example Input
48 18
Example Output
6
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Number TheoryModerate50 Points
CHALLENGE 14Intermediate

Binary Badge Converter

Core Skill: Decimal to Binary

Problem SolvingOnline Judge60 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Binary Badge Converter

During the CodeBhavya Placement Sprint, the Binary Badge Converter challenge tests careful problem solving. Implement a reliable solution to convert a decimal number to binary without using library conversion functions.

🎯 Your Task

Convert a decimal number to binary without using library conversion functions.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 1000 for array challenges; values fit in a 32-bit signed integer unless stated.

Example Input
13
Example Output
1101
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Problem SolvingIntermediate60 Points
CHALLENGE 15Intermediate+

Active Skill Bit Counter

Core Skill: Count Set Bits

BitwiseOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Active Skill Bit Counter

During the CodeBhavya Placement Sprint, the Active Skill Bit Counter challenge tests careful problem solving. Implement a reliable solution to count the number of set bits in a positive integer.

🎯 Your Task

Count the number of set bits in a positive integer.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

Use non-negative 32-bit integer values unless a specific bit width is stated.

Example Input
29
Example Output
4
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
BitwiseIntermediate+70 Points
CHALLENGE 16Intermediate+

Duplicate Candidate ID

Core Skill: Find Duplicate Number

Duplicate HandlingOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Duplicate Candidate ID

During the CodeBhavya Placement Sprint, the Duplicate Candidate ID challenge tests careful problem solving. Implement a reliable solution to an array contains numbers from 1 to N-1 and exactly one number appears twice. Find the duplicate.

🎯 Your Task

An array contains numbers from 1 to n-1 and exactly one number appears twice. find the duplicate.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 1000 for array challenges; values fit in a 32-bit signed integer unless stated.

Example Input
5


1 3 4 2 3
Example Output
3
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Duplicate HandlingIntermediate+70 Points
CHALLENGE 17Advanced

Target Package Pair

Core Skill: Find Pair with Given Sum

Problem SolvingOnline Judge80 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Target Package Pair

During the CodeBhavya Placement Sprint, the Target Package Pair challenge tests careful problem solving. Implement a reliable solution to determine whether two elements in an array add up to a given target value.

🎯 Your Task

Determine whether two elements in an array add up to a given target value.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 1000 for array challenges; values fit in a 32-bit signed integer unless stated.

Example Input
5 9


2 7 11 15 1
Example Output
2 7
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
Problem SolvingAdvanced80 Points
CHALLENGE 18Intermediate+

Score Frequency Report

Core Skill: Frequency of Array Elements

ArraysCountingOnline Judge70 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Score Frequency Report

During the CodeBhavya Placement Sprint, the Score Frequency Report challenge tests careful problem solving. Implement a reliable solution to produce the frequency of every distinct element in an array.

🎯 Your Task

Produce the frequency of every distinct element in an array.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 1000 for array challenges; values fit in a 32-bit signed integer unless stated.

Example Input
6


2 3 2 4 3 2
Example Output
2 - 3
3 - 2
4 - 1
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysCountingIntermediate+70 Points
CHALLENGE 19Advanced

Three-Bucket Sort Challenge

Core Skill: Sort 0s, 1s and 2s

SortingOnline Judge80 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Three-Bucket Sort Challenge

During the CodeBhavya Placement Sprint, the Three-Bucket Sort Challenge challenge tests careful problem solving. Implement a reliable solution to sort an array containing only 0, 1 and 2 without using a general sorting algorithm.

🎯 Your Task

Sort an array containing only 0, 1 and 2 without using a general sorting algorithm.

📥 Input Format

Read the required value or values from standard input in the order shown in the example.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 1000 for array challenges; values fit in a 32-bit signed integer unless stated.

Example Input
6


2 0 2 1 1 0
Example Output
0 0 1 1 2 2
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
SortingAdvanced80 Points
CHALLENGE 20Hard

Final Skyline Leader Challenge

Core Skill: Leaders in Array

ArraysOnline Judge100 Points
View Challenge →
CODEBHAVYA ORIGINAL CHALLENGE

Final Skyline Leader Challenge

During the CodeBhavya Placement Sprint, the Final Skyline Leader Challenge challenge tests careful problem solving. Implement a reliable solution to an element is called a leader if it is greater than every element to its right. Print all leaders.

🎯 Your Task

An element is called a leader if it is greater than every element to its right. print all leaders.

📥 Input Format

Read N first, followed by the N array values; read any additional value such as K or target when required.

📤 Output Format

Print only the required result in the exact format shown in the example output.

📏 Constraints

1 ≤ N ≤ 1000 for array challenges; values fit in a 32-bit signed integer unless stated.

Example Input
6


16 17 4 3 5 2
Example Output
17 5 2
Explanation: The sample demonstrates the required behavior for this CodeBhavya challenge. Follow the same input/output contract for every valid case.
ArraysHard100 Points
Originality approach: the CodeBhavya challenge stories and presentation on this page are newly authored. Standard programming ideas such as maximum, palindrome, factorial, array rotation and file handling remain standard C concepts; their story framing is written independently rather than copied from another coding platform.
← Previous Topic: Advanced C Preprocessor