17) Write a C++ program to declare a class birthday having data members day, month, year. Accept this information for five objects using pointer to the array of objects.

C++ program to declare a class birthday having data members day, month, year.

Anonymous School

            (Minds of Hacker)

--------------------------------


 Write a C++ program to declare a class birthday having data members day, month, year. Accept this information for five objects using pointer to the array of objects.


C++ Practical





#include<iostream>
using namespace std;
class birthday{
    public:
    int day,year,month;
    void get()
    {
        cout<<"Enter the Birth date , Day,Month,Year respectivaly\n";
        cin>>day>>month>>year;

    }
    void display()
    {
        cout<<"Birtdate Entering by you\n"
        <<day
        <<"/"
        <<month
        <<"/"
        <<year
        <<"\n";

    }
};
int main()
{
    birthday a,*b[2];
    *b=&a;
    for (int i = 0i < 2i++)
    {
        b[i]->get();
    }
       for (int i = 0i < 2i++)
    {
        b[i]->display();
    }
    

}





 *******************Don't Make Learning Hard*****************



Follow us on :-

1) YouTube Channel :- Click Here

2) Blog                     :- Click Here


NextGen Digital... Welcome to WhatsApp chat
Howdy! How can we help you today?
Type here...