C++ Lab
1.Write a program to.
a.Print the sum of digits of a given number.
b.Check whether the given number is Armstrong or not
c.Print the prime number from 2 to n where n is natural number given.
2.Write a program to find largest and smallest elements in a given list of numbers and sort the given list.
3.Write a menu driven program that can perform the following functions on strings. (Use overloadedoperators where possible).
a.Compare two strings for equality (== operator)
b.Check whether first string is smaller than the second (<= operator)
c.Copy the string to another.
d.Extract a character from the string (overload [])
e.Reverse the string.
f.Concatenate two strings (+ operator)
4.Write a program using friend functions and inline functions.
5.Write a program to find area of a rectangle,circle, and square using constructors.
6.Write a program to implement copy constructor.
6.Write a program to implement copy constructor.
7.Write a program to demonstrate single inheritance and multiple inheritances.
8.Write a program to demonstrate hierarchical inheritance and multipath inheritance(using virtual functions)
9.Write a program to demonstrate static polymorphism using method overloading.
10.Write a program to demonstrate dynamic polymorphism using method overriding and dynamic methoddispatch.
11.Write a program to demonstrate the function templatesand class templates.
12.Write a program to menu driven program for accepting two numbers and perform calculator operationsaddition, subtraction, multiplication, division and remainder using function template.
13.Write a program to demonstrate exception handling.
14.Write a program to demonstrate various input-output manipulations.
15.Write a program to implement stack abstract data type.
16.Write a program to demonstrate array of objects.
Note: Recommended to use Open Source Software: GCC on Linux; DevC++ (or) CodeBlocks on Windows 10
No comments:
Post a Comment