Write executable code of following problem statements
1. Given an array of size n, rotate it to the right by k steps.
2. Move all zero elements to the end of the array while maintaining the relative order of non-zero elements.
3. Given an array of size n containing numbers from 1 to n, find all duplicate elements.
4. Find the element that appears more than thrice in an array.
5. Find the first element that is repeated in the array.
6. Write a C++ program that uses functions to manage a student’s result. Create a function inputMarks() that takes marks of 5
subjects as arguments and stores them in an array.
Create a function calculateTotal() that returns the total marks.
Create a function calculatePercentage() that returns the percentage.
Create a function displayGrade() that displays the grade according to percentage:
7. Create a function that checks whether a given number is prime or not and returns 1 for prime and 0 for non-prime.
8. Write a program that uses a function to calculate and return the average of elements in an integer array.
9. Write functions for addition, subtraction, multiplication, and division. Call the required function based on user choice.
10. Write a function that checks whether a number is an Armstrong number, using function.
11. Create a Bank Account class with account number, holder name, and balance.
Initialize data using a constructor.
Perform deposit and withdraw operations.
Use a destructor to display “Account closed”.
12. Create a Product class with product ID, name, and price.
Use constructor to initialize product details.
Function calculates discount.
Destructor confirms item removal from cart.
13. Create a Book class with:
Book ID and title as normal members.
A static data member to store the total number of books.
A static function to display total books in the library.
14. Create a Car class:
Brand and model as non-static members.
A static data member to count total cars.
Static function to display available car count.