i have to use +=,-=,/= or *= for this:
c=3-c;
please help me
i hope this explains everything to you, as my english is not that good
i have to use +=,-=,/= or *= for this:
c=3-c;
please help me
i hope this explains everything to you, as my english is not that good
Well if you had
c = c - 3;
The short form would be
c -= 3;
I don't think there is a shortened form for c=3-c;
i also think there is no way, but my "so called" teacher gave me this from a c-examples book.
the 1st example was:
x = x+1 --> x+=1
the 2nd:
a = a-8 --> a-=8
the 3rd:
c = 3-c --> ????????
he also wants that nobody helps me at the place where i am right now, so i decided to write to this board
Well there is no single statement way to achieve it
But there is a dumb two statement way
c *= -1;
c += 3;
This uses the comma sequencer operator.Code:c *= -1, c += 3;
I'm pretty sure this one or the last one should be good enough for your assignment.