0% found this document useful (0 votes)
22 views2 pages

C++ Basics: Beginner Exercises

This document lists 30 C++ practice problems for beginners, covering basic programming concepts such as input/output, arithmetic operations, control structures, and data structures. The problems include tasks like printing messages, performing calculations, manipulating arrays and strings, and implementing algorithms. Additionally, it provides links to a website for further resources.

Uploaded by

khanyyasir40
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)
22 views2 pages

C++ Basics: Beginner Exercises

This document lists 30 C++ practice problems for beginners, covering basic programming concepts such as input/output, arithmetic operations, control structures, and data structures. The problems include tasks like printing messages, performing calculations, manipulating arrays and strings, and implementing algorithms. Additionally, it provides links to a website for further resources.

Uploaded by

khanyyasir40
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/ 2

C++ Practice Problems for Beginners

1. Write a program to print "Hello, World!" to the console.


2. Create a program that reads two integers and outputs their
sum.
3. Write a program that calculates the area of a circle given
its radius.
4. Write a program to swap two numbers using a temporary
variable.
5. Create a program to check whether a number is odd or
even.
6. Write a program to find the maximum of three numbers.
7. Implement a simple calculator that can perform addition,
subtraction, multiplication, and division.
8. Write a program to find the factorial of a number using a
loop.
9. Create a program to reverse the digits of an integer.
10. Write a program that prints all even numbers between 1
and 100.
11. Write a program to generate the first N Fibonacci numbers.
12. Create a program to find whether a given year is a leap
year or not.
13. Write a program to calculate the sum of the digits of a
given number.
14. Create a program that converts temperature from Celsius
to Fahrenheit and vice versa.
15. Write a program to find the greatest common divisor
(GCD) of two numbers.
16. Write a program to compute the power of a number using
a loop.
17. Create a program to check whether a string is a
palindrome.
18. Write a program to count the number of vowels and
consonants in a given string.
19. Implement a program that reads an array of integers and
finds the largest and smallest numbers in the array.
20. Write a program to sort an array of integers in ascending
order using a sorting algorithm (e.g., bubble sort).
21. Create a program to merge two sorted arrays into a single
sorted array.
22. Write a program to find the second largest element in an
array.

Visit my website: https://mehtab.netlify.app/


23. Implement a program to find the frequency of each
element in an array.
24. Write a program to implement a basic matrix multiplication.
25. Create a program to transpose a given matrix.
26. Write a program to find the sum of elements in each row
and column of a matrix.
27. Create a program that counts how many times a character
appears in a string.
28. Write a program to reverse a given string without using
any built-in functions.
29. Implement a program to check if two strings are anagrams
of each other.
30. Write a program to calculate the sum of two complex
numbers using structures.

Visit my website: https://mehtab.netlify.app/

You might also like