🔀 Conditional Statements

Master decision-making in C++ with if, else, else-if, and nested conditionals. Build logic and control flow skills through practical exercises.

#001 Easy

Check if Two Numbers are Equal

Learn basic if-else statements by checking equality of two numbers using comparison operators.

if-else equality comparison
#002 Easy

Check Odd or Even

Use modulo operator and if-else to determine if a number is odd or even. Learn when to omit braces.

modulo if-else divisibility
#003 Easy

Check Divisibility by 3

Master else-if ladder by checking divisibility and reporting remainders. Mix brace styles effectively.

else-if divisibility modulo
#004 Easy

Pass or Fail

Use less than operator to check grade thresholds. Learn comparison operators and boundary conditions.

comparison threshold if-else
#005 Easy

Find Minimum of Two Numbers

Compare two numbers to find minimum. Introduction to cmath library and min() function.

comparison cmath min()
#006 Easy

Find Maximum of Two Numbers

Use greater than operator to find maximum. Learn max() function and real-world applications.

comparison cmath max()
#007 Easy

Positive, Negative or Zero

Master three-way decision making with else-if ladder. Classify numbers into mutually exclusive categories.

else-if classification comparison
#008 Easy

HI, HELLO or HIHELLO

Learn compound conditions with AND operator. Master mutually exclusive conditions and divisibility rules.

AND operator compound conditions divisibility
#009 Easy

X and Y Axis Problem

Track position on 2D grid with OR operator. Learn coordinate systems and character comparison.

OR operator coordinates character
#010 Easy

Check Vowel or Consonant

Chain multiple OR conditions to classify characters. Master case-insensitive character validation.

OR operator character classification
#011 Medium

Check Leap Year

Learn leap year logic with complex conditions. Master the 400-100-4 rule and operator precedence.

complex conditions operator precedence calendar logic
#012 Easy

Day of Week

Learn switch statement for multi-way branching. Master case labels, break statements, and default handling.

switch statement multi-way branching break
#013 Easy

Print Month Name

Practice switch statement with 12 cases. Master month name mapping and range validation.

switch statement validation 12 cases
#014 Easy

Character Case Checker

Determine if a character is uppercase or lowercase using ASCII ranges and conditional logic.

character ASCII case checking
#015 Easy

Character Type Identifier

Classify characters as alphabet, digit, or special character using else-if ladder and ASCII ranges.

else-if ASCII ranges classification
#016 Easy

Calculate Gross Salary

Calculate employee gross salary with conditional HRA and DA percentages. Master floating-point precision and iomanip.

else-if ladder floating-point iomanip real-world
#017 Easy

Grade Calculator

Assign grades based on marks using else-if ladder. Learn range-based classification and optimize conditional logic.

else-if ladder range checking grading system
#018 Easy

Simple Calculator

Build a calculator with operator detection using character comparison. Master switch-like logic with else-if ladder.

character comparison calculator logic operators
#019 Medium

Electricity Bill Calculator

Calculate electricity bills with tiered pricing and surcharges. Master cumulative calculations and real-world billing logic.

tiered pricing cumulative calc real-world
#020 Easy

Triangle Validity Checker

Apply triangle inequality theorem to validate three sides. Master compound conditions and geometric logic.

triangle inequality compound AND geometry
#021 Easy

Triangle Type Classifier

Classify triangles as Equilateral, Isosceles, or Scalene. Master conditional priority and logical operators.

classification AND/OR logic condition order
#022 Easy

Triangle Angle Validator

Validate triangles using angle sum property. Master compound conditions with zero and negative checks.

angle sum validation edge cases
#023 Easy

Find Minimum of Three Numbers

Find the smallest value among three numbers. Master comparison logic and built-in min() function.

comparison logic min function multiple methods
#024 Easy

Find Maximum of Three Numbers

Find the largest value among three numbers. Master greater-than logic and built-in max() function.

comparison logic max function inverse of min
#025 Easy

Find Largest of Four Numbers

Find the largest among four values. Master nested max() functions and C++11 initializer lists.

nested functions initializer list scalability
#026 Easy

Sort Three Numbers Using Macros

Sort three numbers in ascending order using C++ macros. Master preprocessor directives, ternary operators, and macro definitions.

macros ternary operator preprocessor
#027 Easy

Sort Four Numbers in Descending Order

Sort four numbers from largest to smallest using elimination logic. Master nested min/max functions and conditional elimination techniques.

elimination logic nested functions descending order
#028 Easy

Time Validator

Validate time format (HH:MM:SS) using range checking. Master 24-hour format validation and compound conditions.

time validation range checking input parsing
#029 Easy

Data Type Limits Display

Display min/max values of C++ data types using climits library. Master switch statements and understand signed/unsigned type ranges.

climits library switch statement signed/unsigned
#030 Easy

Date Validator with Leap Year Detection

Validate dates with leap year detection and month-based day checking. Master complex multi-step validation and calendar logic.

leap year complex validation calendar logic