dotfiles/.config/Code/User/History/1591c2fd/kFrd.cpp
RafayAhmad7548 ab03d5f10c test
2024-06-16 18:53:25 +05:00

42 lines
No EOL
468 B
C++

/*
Rafay Ahmad
23I-2526
*/
#include <iostream>
using namespace std;
class Complex{
int real;
int img;
public:
Complex(){}
Complex(int real, int img) : real(real), img(img){}
friend ostream& operator<<(ostream&, Complex&);
};
ostream& operator<<(ostream& out, Complex& c){
out<<c.real<<"+"<<c.img<<"i\n";
return out;
}
int main(){
Complex c1(1, 2);
Complex c2(2, 3);
cout<<c1;
return 0;
}