Operators

# Operators - Operators COP3014 Dr David Gaitros copyright...

This preview shows pages 1–5. Sign up to view the full content.

copyright 2010 Dr. David Gaitros, FSU Operators COP3014 Dr. David Gaitros

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
copyright 2010 Dr. David Gaitros, FSU Assignment Operators C++ provides several assignment operators for abbreviating assignment expressions Any statement of the form: variable = variable operator expression; Where operator is one of the binary operators +, - , *, /, or % You can also do a short hand: variable operator=expression;
copyright 2010 Dr. David Gaitros, FSU operators Assignment Operators Sample Expression Explanation += c += 7; Add 7 to c and put the results in c. -= c-=7; Subtract 7 from c and put the results in c *= c*=7; Multiply 7 by c and put the results in c /= c/=7; Divide c by 7 and put the results in c %= c%7; Find the reminder of C divided by 7 and put the results in c

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
copyright 2010 Dr. David Gaitros, FSU Increment and Decrement operators Unary increment operator ++; Unary decrement operator --; Operator placed before variable: Operation is accomplished as if placed before the statement.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern