Question:
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();
}
C. Sir| Created: 9-Jan-2019 | Updated: 22-Mar-2026|CBSE12D-2016
