#include<iostream.

h> class Array { private: int array[10]; public: Array() { for(int i=0;i<10;i++) array[i]=0; } void operator++() { for(int y=0;y<10;y++) ++array[y]; } void operator ++(int) { for(int l=0;l<10;l++) array[l]++; } Array operator +(Array arr) { for (int i=0;i<10;i++) array[i]=array[i]+arr.array[i]; return *this; } int operator ==(Array arr1) { int e=0; for(int c=0;c<10;c++) { if (array[c]==arr1.array[c]) e++; } if (e==10) return 1; else return 0; } friend ostream&operator <<(ostream&, Array&); friend istream&operator >>(istream&, Array&); }; istream&operator >>(istream&in, Array&o1) { for (int j=0;j<10;j++) in>>o1.array[j]; return in; } ostream&operator <<(ostream&out,Array&o2) { for (int k=0;k<10;k++) out<<"\t"<<o2.array[k]<<endl; return out; }

++a1.a2. cout<<"Your output 2 is "<<endl. a2++. cout<<"Post increment "<<endl. cin>>a2. cout<<"Enter array 2 members "<<endl. cin>>a1.void main () { Array a1. int a=(a1==a2). else cout<<"Not equal". cout<<a1. cout<<a3. cout<<"Your output 1 is "<<endl. } . cout<<a1. cout<<"==========='". a3=a1+a2. if (a==1) cout<<"Arrays are equal". cout<<a1. cout<<"Enter array 1 members"<<endl.a3. cout<<" Incremented values "<<endl.

Sign up to vote on this title
UsefulNot useful