← All languages

Logic building programs

Conditionals, loops, recursion, arrays, strings — six phases of problems.

29 topics · 319 examples · ordered like a syllabus

Open the first problem

Topics, in order

Finish one. The next is the card below.

  1. 01Phase 1 - Level 1: Simple ConditionsPractice basic conditional thinking with simple if-else statements and boolean logic.
    • Check if Number is Positive, Negative, or Zero
    • Check if a Number is Even or Odd
    • Check if a Number is Divisible by 5
    10 programs →
  2. 02Phase 1 - Level 2: Nested If & Multiple ConditionsMaster nested conditions and multiple condition combinations.
    • Check if Three Sides Form a Valid Triangle
    • Determine Triangle Type
    • Grade Calculator
    10 programs →
  3. 03Phase 1 - Level 3: Math and Number LogicSolve mathematical and number logic problems using conditionals.
    • Check if All Digits are Distinct
    • Check Middle Digit
    • Check First and Last Digits Equal
    10 programs →
  4. 04Phase 1 - Level 4: Logical Operators & Compound StatementsMaster logical operators and compound conditional statements.
    • Check Letter, Digit, or Neither
    • FizzBuzz Problem
    • Find Median Value
    10 programs →
  5. 05Phase 1 - Level 5: Creative / Tricky Logical ScenariosSolve creative and tricky logical problems using advanced conditional thinking.
    • Point Location on Axes
    • Check Pythagorean Triplet
    • Check Valid Calendar Date
    10 programs →
  6. 06Phase 2 - Level 1: Basic LoopingMaster basic loops - for and while loops for iteration.
    • Print Numbers from 1 to 10
    • Print All Even Numbers Between 1 and 100
    • Sum of First N Natural Numbers
    14 programs →
  7. 07Phase 2 - Level 2: Number-based Looping LogicApply loops to solve number manipulation problems.
    • Count Digits in a Number
    • Reverse a Number
    • Check Palindrome Number
    14 programs →
  8. 08Phase 2 - Level 3: Mathematical & Logical PatternsMaster mathematical series, sequences, and logical patterns using loops.
    • Print Squares from 1 to N
    • Print Cubes from 1 to N
    • Numbers Divisible by 7
    13 programs →
  9. 09Phase 2 - Level 4: Pattern PrintingMaster nested loops to print various patterns.
    • Print Right Triangle Pattern
    • Print Inverted Right Triangle
    • Print Pyramid Pattern
    13 programs →
  10. 10Phase 2 - Level 5: Logical Loop CombinationsCombine loops with complex logic - filtering, conditional accumulation.
    • Numbers with Even Digit Sum
    • Count Numbers Divisible by 7 but Not 5
    • All Palindrome Numbers 1-500
    12 programs →
  11. 11Phase 3 - Level 1: Basic RecursionIntroduction to recursion - functions that call themselves.
    • Print 1 to N Recursively
    • Factorial Using Recursion
    • Print N to 1 Recursively
    10 programs →
  12. 12Phase 3 - Level 2: Advanced RecursionMaster advanced recursive patterns - digit operations, GCD, binary conversion.
    • Count Digits Recursively
    • Reverse Number Recursively
    • Check Palindrome Recursively
    10 programs →
  13. 13Phase 3 - Level 3: Pattern RecursionPrint patterns using recursion.
    • Print Line of N Stars Recursively
    • Print Square of Stars Recursively
    • Print Triangle (Top-Down) Recursively
    10 programs →
  14. 14Phase 3 - Level 4: String-based RecursionApply recursion to string operations.
    • Reverse String Recursively
    • Check Palindrome String Recursively
    • Count Vowels Recursively
    10 programs →
  15. 15Phase 4 - Level 1: Basic ArraysIntroduction to arrays - storing and accessing multiple values.
    • Input N Integers and Print Them
    • Sum of Array
    • Maximum Element
    10 programs →
  16. 16Phase 4 - Level 2: Searching & Counting LogicMaster array searching, counting occurrences, and finding elements.
    • Check if Element Exists
    • Count Occurrences
    • Find First Occurrence
    10 programs →
  17. 17Phase 4 - Level 3: TransformationTransform arrays - reverse, rotate, swap, and create new arrays.
    • New Array of Squares
    • New Array with Only Even Elements
    • Replace Negatives with 0
    10 programs →
  18. 18Phase 4 - Level 4: Aggregation & ComparisonCompare arrays, merge arrays, find common elements.
    • Compare Arrays (Same Order)
    • Compare Arrays (Ignore Order)
    • Merge Two Arrays
    10 programs →
  19. 19Phase 4 - Level 5: Logical & AppliedApply array logic to solve complex problems.
    • Check if Array is Sorted (Ascending)
    • Check if Array is Sorted (Descending)
    • Find Second Largest
    14 programs →
  20. 20Phase 5 - Category 1: Basic String HandlingMaster fundamental string operations.
    • Length of String
    • Reverse String
    • Convert to Uppercase
    10 programs →
  21. 21Phase 5 - Category 2: Character OperationsMaster character-level string operations.
    • Print First Character
    • Print Last Character
    • Print Each Character
    10 programs →
  22. 22Phase 5 - Category 3: Word OperationsMaster word-level string operations.
    • Print First Word
    • Print Last Word
    • Reverse Order of Words
    10 programs →
  23. 23Phase 5 - Category 4: String TransformationTransform strings - replace, remove, insert operations.
    • Replace Character
    • Remove Character
    • Insert Character at Position
    10 programs →
  24. 24Phase 5 - Category 5: Advanced String LogicSolve complex string problems with advanced logic.
    • Check Anagram
    • Check if Substring Exists
    • Count Substring Occurrences
    14 programs →
  25. 25Phase 6 - Category 1: Number LogicApply all learned concepts to solve complex number logic problems.
    • Complex Number Validation
    • Number Meeting Multiple Conditions
    • Perfect Numbers in Range
    10 programs →
  26. 26Phase 6 - Category 2: Array & String CombinationsCombine array and string operations to solve complex problems.
    • Convert Array to String
    • Convert String to Array of Digits
    • Count Vowels in Array of Strings
    10 programs →
  27. 27Phase 6 - Category 3: Loop & Conditional MixCombine loops and conditionals for complex logic.
    • Print Primes 1 to N
    • Sum of Primes in Range
    • Count Composite Numbers
    10 programs →
  28. 28Phase 6 - Category 4: Mathematical CombinationsCombine mathematical concepts with programming logic.
    • Sum of Squares
    • Sum of Cubes
    • Alternating Sum
    10 programs →
  29. 29Phase 6 - Category 5: Real-World Logic ProblemsSolve real-world inspired logic problems.
    • Password Strength Checker
    • Advanced Grade Calculator
    • BMI Calculator with Category
    15 programs →