C++ Programs List
Program 2: WAP to reverse a number.
Program 9: WAP to perform following actions on an array entered by the user:
a)Print the even-valued elements.
b)Print the odd-valued elements.
c)Calculate and print the sum and average of the elements of user.
d)Print the maximum and minimum elements of array.
e)Remove the duplicates from the array.
f)Print the array in reverse order.
Program 11: WAP that swaps two numbers using pointers.
Program 12: WAP to generate pay-slip of salaried employee.
Program 13: Write a menu driven program to perform following operations on strings:
a)Show address of each character in string.
b)Concatenate two strings without using strcat function.
c)Concatenate two strings using strcat function.
d)Compare two strings.
e)Calculate the length of the string (use pointers).
f)Convert all lowercase characters to uppercase.
g)Convert all uppercase characters to lowercase.
h)Calculate the number of vowels.
i)Reverse the string.
Program 16: Create the Person class. Create some objects of this class (by taking information from the user). Inherit the class Person to create two classes Teacher and Student class. Maintain respective information in the classes and create, display and delete objects of these two classes. (Use Run Time Polymorphism).
Program 19: Create a class Box containing length, breadth and height. Include the following methods in it:
a)Calculate Surface Area
c)Add, Overload + operator (to add two boxes length, breadth and height)
d)Overload operator = = (to check equality of two boxes), as a friend function
e)Overload Assignment operator
f)Check if its a cube or cuboid.
WAP which takes input from user for length, breadth and height to test the above class.
Program 20: Create a class Length containing feet and inch. Include following functions
a)Input Length object
b)Overload + operator (to add two lengths)
c)Overload – operator (to subtract two lengths)
d)Display Length object
WAP which takes input from user for feet and inch to test the above class.