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

Basic CPP 30 Practice Questions

The document contains a list of basic C++ programming practice questions aimed at beginners. It includes tasks such as printing personal information, performing arithmetic operations, manipulating arrays, and implementing functions and structures. The exercises cover fundamental programming concepts including conditionals, loops, recursion, and string manipulation.

Uploaded by

Top up Central
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)
31 views2 pages

Basic CPP 30 Practice Questions

The document contains a list of basic C++ programming practice questions aimed at beginners. It includes tasks such as printing personal information, performing arithmetic operations, manipulating arrays, and implementing functions and structures. The exercises cover fundamental programming concepts including conditionals, loops, recursion, and string manipulation.

Uploaded by

Top up Central
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

Basic C++ Programming Practice Questions

1. Write a C++ program to print your name, roll number, and department.

2. Write a program to perform basic arithmetic operations.

3. Write a program to swap two numbers using a temporary variable.

4. Write a program to swap two numbers without using a temporary variable.

5. Write a program to check if a number is even or odd.

6. Write a program to check if a number is positive, negative, or zero.

7. Write a program to find the largest of three numbers.

8. Write a program to check whether a year is a leap year.

9. Write a calculator program using switch case.

10. Write a program to print natural numbers from 1 to N.

11. Write a program to display multiplication table of a given number.

12. Write a program to find the factorial of a number.

13. Write a program to check whether a number is prime.

14. Write a program to generate the Fibonacci series up to N terms.

15. Write a program to input and display elements of an array.

16. Write a program to find the largest and smallest elements in an array.

17. Write a program to reverse an array.

18. Write a program to perform matrix addition.

19. Write a program to perform matrix subtraction.

20. Write a program to remove duplicate elements from an array.

21. Write a program to sort an array in ascending and descending order.

22. Write a program to check if a string is a palindrome.

23. Write a program to count vowels and consonants in a string.

24. Write a program to compare two strings.

25. Write a program to convert lowercase letters to uppercase and vice versa.
26. Write a program to add two numbers using function overloading.

27. Write a recursive function to calculate factorial.

28. Write a recursive function to find GCD of two numbers.

29. Create a structure to store student details and display them.

30. Write a program using pointer to access and modify array elements.

You might also like