/* Rafay Ahmad 23I-2526 */ #include using namespace std; class Vector{ int size; int *arr; public: Vector(int size) : size(size){ arr = new int[size]; } Vector(const Vector& other) : size(other.size){ arr = new int[size]; for(int i=0;isize && iarr[i] + other.arr[i]; } if(this->size > other.size) for(int i=this->size-other.size;isize;i++) result.arr[i] = this->arr[i]; else if(this->size < other.size) for(int i=other.size-this->size;isize && iarr[i] - other.arr[i]; } if(this->size > other.size) for(int i=this->size-other.size;isize;i++) result.arr[i] = this->arr[i]; else for(int i=other.size-this->size;isize;i++) this->arr[i] *= n; return *this; } Vector operator/(int n){ if(n != 0) for(int i=0;isize;i++) this->arr[i] /= n; return *this; } Vector operator+=(Vector& other){ *this = *this + other; return *this; } Vector operator-=(Vector& other){ *this = *this - other; return *this; } bool operator==(Vector& other){ if(this->size != other.size) return false; for(int i=0;isize;i++) if(this->arr[i] != other.arr[i]) return false; return true; } bool operator!=(Vector& other){ return !(*this == other); } friend ostream& operator<<(ostream& output, Vector& other); friend istream& operator>>(istream& output, Vector& other); ~Vector(){ delete[] arr; } }; ostream& operator<<(ostream& output, Vector& other){ output<<"Size: "<>(istream& input, Vector& other){ cout<<"Enter Size: "; input>>other.size; delete[] other.arr; other.arr = new int[other.size]; cout<<"Enter values\n"; for(int i=0;i>other.arr[i]; return input; } int main(){ Vector v1(5); Vector v2(5); cout<<"Enter values for v1: "; cin>>v1; cout<<"Enter values for v2: "; cin>>v2; cout<< "v1: "<