#include <iostream>
using namespace std;
class complex
{
public:
int a,b,c,d;
friend void sum();
void input()
{
cin>>a>>b>>c>>d;
}
void display()
{
cout<<a+c<<"+i"<<b+d;
}
};
void sum(complex obj)
{
}
int main()
{
complex obj;
obj.input();
obj.display();
return 0;
}
using namespace std;
class complex
{
public:
int a,b,c,d;
friend void sum();
void input()
{
cin>>a>>b>>c>>d;
}
void display()
{
cout<<a+c<<"+i"<<b+d;
}
};
void sum(complex obj)
{
}
int main()
{
complex obj;
obj.input();
obj.display();
return 0;
}
works on 90%
ReplyDelete100% as of now
Delete0% now
ReplyDelete//Works!
ReplyDelete#include
using namespace std;
class A{
public:
int a;
void display(int a)
{
cin>>a;
}
};
class B{
public:
int b;
void display(int b){
cin>>b;
}
};
class C:public A,public B
{
public:
int a, b;
void display()
{
cin>>a>>b;
cout<<a*b<<endl;
}
}sample;
int main()
{
sample.display();
return 0;
}
👍
Delete#include
ReplyDeleteusing namespace std;
class A{
public:
int pen;
void display(){
cin>>pen;
}};
class B{
public:
int price;
void display(){
cin>>price;
}};
class C : public A, public B{
public:
void display(){
A::display();
B::display();
cout << pen*price;
}};
int main()
{
C sample;
sample.display();
return 0;
}