Half hand operator program.

in programming •  7 years ago  (edited)

Hey steemit and steemians.

lets look at hand hand operator  Subtraction (-) program.

Using C++

Program Body:

#include <iostream>

#include <string>

using namespace std;

class damon{

int a;

public:

    damon(){

    a=0;

    }

    damon(int b){

    a=b;

    }

    void operator-=(int wolf){

    a=a-wolf;

    }

    void depict(){

    cout<<a<<endl;

    }

};

int main (){

damon vamp(80);

vamp-=10;

vamp.depict();


return 0;

}

Working:

the object of class is  Subtracted it is for single one.

Thanks I hope you  liked it


Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

I always upvote and comment your post sir, @learnandgrow, and you always upvote me. you are very good

Thank you for Using #promo-steem tag, Promote steemit by inviting your friends and your family!

Mantap post nya

didn't get you?

Tak paham saya?

I dont understand your language...can you speak english

What does your status mean?

let me explain.
I am bioinformatics's student ..we are students those have biological skills as well as computational and programming skills..known as bioinformaticians and scientists ..and I am steemian as you can see..
thats all @zaynfauzie

You got a 1.73% upvote from @upme requested by: @learnandgrow.
Send at least 1.5 SBD to @upme with a post link in the memo field to receive upvote next round.
To support our activity, please vote for my master @suggeelson, as a STEEM Witness