#include <iostream>
using namespace std;
class increment
{
public:
float a,b,c;
void getx()
{
cin>>a>>b>>c;
}
void operator ++();
};
void increment::operator ++()
{
a=a+1.0;
b=b+1.0;
c=c+1.0;
cout<<a<<" "<<b<<" "<<c;
}
int main() {
increment obj;
obj.getx();
obj.operator ++();
return 0;
}
using namespace std;
class increment
{
public:
float a,b,c;
void getx()
{
cin>>a>>b>>c;
}
void operator ++();
};
void increment::operator ++()
{
a=a+1.0;
b=b+1.0;
c=c+1.0;
cout<<a<<" "<<b<<" "<<c;
}
int main() {
increment obj;
obj.getx();
obj.operator ++();
return 0;
}
evaluates only 88%
ReplyDeleteDeclare a,b,c as double not float it will be 100%.
ReplyDelete#include
ReplyDeleteusing namespace std;
class increment
{
public:
float a,b,c;
void getx()
{
cin>>a>>b>>c;
}
void operator ++();
};
void increment::operator ++()
{
a=a+1.0;
b=b+1.0;
c=c+1.0;
cout<<a<<" "<<b<<" "<<c;
}
int main() {
increment obj;
obj.getx();
obj.operator ++();
return 0;
}