#include <iostream.h>

class Integers
{

private:
 int num;

 void UpdateValue(int v);

public:
 Integers(int n = 0);
 int IsEven();
 friend void Print(Integers A_Obj); 
//Declare the general function, Print, as a friend of this class.

};

void Print(Integers A_Obj);
//General funstion, function prototype.

void main()
{
 Integers B_Obj;

 Print(B_Obj);
}

void Print(Integers A_Obj)
{
 int temp;
 cout << "The value of num is " << A_Obj.num << endl;
        /*Since Print is a friend function of Integers class, it can access a private data.*/
 cout << "What value do you want to increase?" << endl;
 cin >> temp;
 A_Obj.UpdateValue(temp);
/*Since Print is a friend function of Integers class, it can access a private function*/
 cout << "The new value of num is " << A_Obj.num << endl;
}

Integers::Integers(int n)
{
 num = n;
}

void Integers::UpdateValue(int v)
{
 num = num + v;
}

int Integers::IsEven()
{
 return (num % 2) == 0;
}