Learning path

C/C++ practice problems

Classic beginner exercises on numbers, text and arrays, solved in both C and C++, each with a challenge to try on your own.

18 lessons · 22 challenges

Start the path →

1 Numbers and digits 8 lessons

  1. Lesson 2 challenges Check a Prime Number Determine whether an integer is prime.
  2. Lesson 1 challenge Fibonacci Sequence Generate the first ten Fibonacci numbers.
  3. Lesson 1 challenge Calculate a Factorial Calculate a factorial with an iterative loop.
  4. Lesson 2 challenges Greatest Common Divisor Find the greatest common divisor of two integers.
  5. Lesson 1 challenge Check a Leap Year Determine whether a year is a leap year.
  6. Lesson 1 challenge Decimal to Binary Convert a positive decimal integer to binary.
  7. Lesson 1 challenge Temperature Converter Convert Celsius to Fahrenheit.
  8. Lesson 1 challenge Simple Calculator Apply an arithmetic operator to two numbers.

2 Text problems 5 lessons

  1. Lesson 1 challenge Reverse a String Reverse text without changing its characters.
  2. Lesson 1 challenge Check a Palindrome Check whether a word reads the same in both directions.
  3. Lesson 1 challenge Count Vowels Count vowels in a line of text.
  4. Lesson 1 challenge Count Words Count whitespace-separated words in a sentence.
  5. Lesson 1 challenge Character Frequency Count occurrences of each lowercase letter.

3 List problems 5 lessons

  1. Lesson 1 challenge Sum Array Values Calculate the sum of all values in an array.
  2. Lesson 2 challenges Find the Largest Array Value Find the maximum value in an array.
  3. Lesson 1 challenge Find the Second Largest Value Find the second distinct largest array value.
  4. Lesson 1 challenge Remove Duplicate Values Remove repeated array values while preserving order.
  5. Lesson 2 challenges Transpose a Matrix Exchange matrix rows and columns.