Good Morning
05:43 am

Sponsor Area

Sponsor Area

Question is

Find and write the output of the following C++ program code:
Note: Assume all required header files are already being included in the program.

class Stock
{
	long int ID;
	float Rate; int Date;
public:
	Stock(){ID=1001;Rate=200;Date=1;}
	void RegCode(long int I,float R)
	{
		ID=I; Rate=R;
	}
	void Change(int New,int DT)
	{
		Rate+=New; Date=DT;
	}
	void Show()
	{
		cout<<'Date :'<<Date<<endl;
		cout<<ID<<'#'<<Rate<<endl;
	}
};

void main()
{
	Stock A,B,C;
	A.RegCode(1024,150);
	B.RegCode(2015,300);
	B.Change(100,29);
	C.Change(20,20)
	;
	A.Show();
	B.Show();
	C.Show();
}

Mock Test Series

Sponsor Area

Sponsor Area

NCERT Book Store

NCERT Sample Papers

Entrance Exams Preparation