0% found this document useful (0 votes)
23 views3 pages

CPP Practice Problems

The document outlines a series of C++ practice problems categorized into four main sections: Basic If-Else, Loops, Functions, Arrays, and Math-based problems. Each section contains a list of beginner to intermediate programming tasks aimed at enhancing the understanding and application of C++ concepts. The problems cover a wide range of topics including conditional statements, loops, functions, array manipulations, and mathematical computations.

Uploaded by

devvv.2218
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views3 pages

CPP Practice Problems

The document outlines a series of C++ practice problems categorized into four main sections: Basic If-Else, Loops, Functions, Arrays, and Math-based problems. Each section contains a list of beginner to intermediate programming tasks aimed at enhancing the understanding and application of C++ concepts. The problems cover a wide range of topics including conditional statements, loops, functions, array manipulations, and mathematical computations.

Uploaded by

devvv.2218
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

C++ Practice Problems - Beginner to Intermediate

Basic If-Else Practice Programs


1. Check even or odd number
2. Find the greatest of two numbers
3. Find the greatest among three numbers
4. Check if a year is a leap year
5. Check if a character is vowel or consonant
6. Check if number is positive, negative, or zero
7. Check eligibility to vote
8. Check if number is divisible by 5 and 11
9. Check if a number is a 3-digit number
10. Check if a student passed or failed based on marks

Loops Practice Programs


1. Print numbers from 1 to N using for/while loop
2. Print multiplication table of a number
3. Calculate the sum of first N natural numbers
4. Factorial of a number using loop
5. Reverse a number
6. Check if a number is a palindrome
7. Print Fibonacci series up to N terms
8. Find the number of digits in a number
9. Calculate the sum of digits of a number
10. Check Armstrong number

Functions Practice Programs


1. Function to calculate sum of two numbers
2. Function to find maximum of two numbers
3. Function to calculate factorial of a number
4. Function to check prime number
5. Function to check palindrome
6. Function to find power (a^b)
7. Function to print Fibonacci series
8. Function to reverse digits of a number
9. Function to find GCD and LCM of two numbers
10. Function to swap two numbers

Arrays Practice Programs


1. Input and print all elements of an array
2. Find maximum and minimum element in array
3. Calculate sum of array elements
4. Reverse an array
5. Count even and odd elements in array
6. Sort array in ascending/descending order
7. Find second largest element in array
8. Find duplicate elements in array
9. Merge two arrays into one
10. Insert an element at a given position
11. Delete an element from array
12. Search for an element in array (Linear search)
13. Sort using bubble sort / selection sort
14. Copy all elements of one array into another
15. Check if array is a palindrome

Math-based Practice Programs


1. Find the sum of two numbers
2. Find the product of two numbers
3. Calculate the square and cube of a number
4. Find the factorial of a number
5. Check if a number is prime
6. Check if a number is an Armstrong number
7. Check if a number is a palindrome
8. Generate Fibonacci series up to N terms
9. Find GCD (HCF) and LCM of two numbers
10. Count the number of digits in a number
11. Sum of digits of a number
12. Reverse the digits of a number
13. Check if a number is perfect (sum of divisors = number)
14. Find power of a number (a^b)
15. Check whether a number is a strong number
16. Check whether a number is a Harshad number
17. Check whether a number is a neon number
18. Check whether a number is a magic number
19. Convert binary to decimal
20. Convert decimal to binary

You might also like