Welcome to the C++ Programming Practice Set!
This list contains 25 beginner-level problems focused on mastering basic C++ syntax and logic-building.
- Print "Hello, C++ World!" to the console.
- Declare and print values of int, double, and char using
cin
andcout
. - Take two numbers as input and swap them without using a third variable.
- Take an input and determine if it's positive, negative, or zero.
- Check if a number is divisible by both 3 and 5.
- Find the sum of all even numbers up to N.
- Check if a year is a leap year.
- Generate multiplication table using
for
loop. - Display all odd numbers between 1 to 50.
- Take a number and determine if it is prime or not using a function.
- Calculate factorial using recursion.
- Count and print all digits of a number.
- Find the sum of the first N natural numbers using loop.
- Print Fibonacci sequence using recursion.
- Take a string input and print its length using
string
class. - Print a square star pattern.
- Print an inverted triangle pattern.
- Check if a character is uppercase or lowercase.
- Use
switch
to create a basic calculator. - Write a program using
while
loop to reverse a number. - Create a simple menu-driven program using
do-while
loop. - Compare two numbers using the ternary operator.
- Demonstrate use of
break
andcontinue
in a loop. - Print all prime numbers between two given numbers.
- Take an array of 10 integers and print their sum.
β¨ Save this list, push your solutions, and build a solid understanding of C++ step by step.
Keep coding and improving! π‘