Example(s):Palindrome, prime, armstrong, "linear search", reverse etc.
Example(s):1575, 1632, 1539 (Only one at a time)
What is the difference between public member and private member of a class.
A public member can be accessed outside the class by creating a class object in other methods.
A private member can only be used within the methods of the same class.
A public member can be accessed by child classes as public, private or protected based on the visibility mode set while deriving the child class.
A private member is not visible to even the child class.
private: int x;
public: int y;
class Son:public Father
private: int p;
public: int q;
x=10 //This is not valid even for a publicly visible child class
y=10; //This is valid as y is publicly visible
F.x=10; // This is not valid as x is private
F.y=2-; //This is valid as y is public