Change phone number - C++ Program

Q. Create a class phone having data members: STD code, Exchange code, Number. Write a C++ program to accept details from users(max 10) and change input phone number to new phone number using following criteria:

a) Add 1 to 1st digit of STD code (If digit is 9, it becomes 10)

b) The exchange code is retained as it is.

c) In 3rd  part of structure, 1st two digits should be reversed. Ex: I/P => 212-766-9801 =>O/P: 312-766-9801

Display all changed phone numbers.


using namespace std;

class phone
        long int std, ex, phno;
        void accept();
        void change();
        void display();
void phone::accept()
        cout<<"\n Enter STD Code        : ";
        cout<<"\n Enter Exchange Code   : ";
        cout<<"\n Enter Phone Number    : ";
void phone::display()
        cout<<" ";
void phone::change()
        long int s, ph, rev, fact;
        int cnt;
        s = std;
        ph = phno;
int main()
        phone p1[10];
        int cnt, i;
        cout<<"\n Enter No. of Elements : ";
        if(cnt<1 || cnt>10)
                cout<<"\n Out of size";
        for(i=0; i<cnt; i++)
        cout<<"\n ------------------------------------------";
        cout<<"\n Original Phone Number : ";
        for(i=0; i<cnt; i++)
        for(i=0; i<cnt; i++)
        cout<<"\n Changed Phone Number  : ";
        for(i=0; i<cnt; i++)
        return 0;


phone number