C++ Fundamentals Practice Problems
Fundamental concepts form the foundation of learning any programming language. They include absolute basic topics such as storing and accessing data, input and output, performing mathematical, logical, operations, etc. So it is important to have clear understanding of fundamentals to move on to the more complex concepts.
Solving practice problems is the best way to improve programming skills in C++. This article provides you practice problems to help learners build a strong foundation.
Easy Problems
These problems are the basic demonstrations of fundamental concepts and their basic usage.
- Print GeeksForGeeks
- Return Size
- Global Variable
- Add Auto Keyword
- Swap the Numbers
- Type Conversion
- Type Inference
- The New Line
- Print with Space
- Print with Separator
- Scientific Format
- Input Integer
- Convert to Hexadecimal
- Last Digit of a Number
- Sum of N Numbers
- Evaluate Formulae
- Find if +ve, -ve, or 0
- Compare Two Numbers
- Leap Year
- Even Odd Game
- Greatest of Three
Medium Problems
Problems in this section focuses on using the fundamental concepts to solve some simple real world problems. It may also need the knowledge of basic mathematical concepts.
- AP Term
- Geometric Progression Term
- The FizzBuzz Program
- GCD
- LCM
- Calculator
- Binary to Decimal
- Decimal to Binary
- Check Prime
- Next Prime Number
- Prime Factorization
- Right Angle Triangle
- Right Angle Triangle 2
- Inverted Right Angle Triangle
- Table Difference
Prerequisite
To solve the above problems, you need to have some basic understanding of C++ fundamentals:
- Variables and Data Types
- Operators
- Input and Output
- Conditional Statements
- Loops
If you want to revise these topics, refer to GeeksforGeeks' C++ Tutorial.
How to solve practice problems?
Each of the above link will take you to the practice portal where the problem statement tells you all the required information about the problem, and you have to write the solution in the code editor.

Once your solution is complete, you can check it for example test case using the compile and run button at the bottom right of the page.

If you are sure of your solution, press the submit button. The GfG's compiler will run your solution for a variety of test cases and if all these cases are passed, you solution will be accepted.
Your own custom cases can also be checked before submission by using Custom Input button but keep in mind to follow the program's input layout.