Coding Practice
Solve problems in the built-in C++ compiler. Use hints only when stuck: they reveal ideas, not solutions.
Personal greeting
beginnerRead a person's first name and print "Hello, <name>!".
AdaHello, Ada!Run it in the built-in C++ compiler
Write your solution in our online compiler (GCC or Clang, C++17/20/23). The sample input is filled in for you, so you can compare your output with the expected output.
Open the compiler →Sum of two numbers
beginnerRead two integers and print their sum.
7 512Run it in the built-in C++ compiler
Write your solution in our online compiler (GCC or Clang, C++17/20/23). The sample input is filled in for you, so you can compare your output with the expected output.
Open the compiler →Rectangle area and perimeter
beginnerRead width and height (integers). Print the area on the first line and the perimeter on the second.
4 312
14Run it in the built-in C++ compiler
Write your solution in our online compiler (GCC or Clang, C++17/20/23). The sample input is filled in for you, so you can compare your output with the expected output.
Open the compiler →Celsius to Fahrenheit
beginnerRead a temperature in Celsius (may have decimals) and print it in Fahrenheit.
2577Run it in the built-in C++ compiler
Write your solution in our online compiler (GCC or Clang, C++17/20/23). The sample input is filled in for you, so you can compare your output with the expected output.
Open the compiler →Even or odd
intermediateRead an integer and print "even" or "odd".
17oddRun it in the built-in C++ compiler
Write your solution in our online compiler (GCC or Clang, C++17/20/23). The sample input is filled in for you, so you can compare your output with the expected output.
Open the compiler →Sum of digits
intermediateRead a non-negative integer and print the sum of its digits.
409619Run it in the built-in C++ compiler
Write your solution in our online compiler (GCC or Clang, C++17/20/23). The sample input is filled in for you, so you can compare your output with the expected output.
Open the compiler →FizzBuzz
intermediateRead n. For each i from 1 to n print Fizz if divisible by 3, Buzz if by 5, FizzBuzz if both, otherwise i.
51
2
Fizz
4
BuzzRun it in the built-in C++ compiler
Write your solution in our online compiler (GCC or Clang, C++17/20/23). The sample input is filled in for you, so you can compare your output with the expected output.
Open the compiler →Prime check
advancedRead n (n ≥ 1) and print "prime" or "not prime".
29primeRun it in the built-in C++ compiler
Write your solution in our online compiler (GCC or Clang, C++17/20/23). The sample input is filled in for you, so you can compare your output with the expected output.
Open the compiler →Reverse a word
advancedRead one word and print it reversed, without using std::reverse.
stackkcatsRun it in the built-in C++ compiler
Write your solution in our online compiler (GCC or Clang, C++17/20/23). The sample input is filled in for you, so you can compare your output with the expected output.
Open the compiler →