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

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: copyright 2010 Dr. David Gaitros, FSU copyright 2010 Dr. David Gaitros, FSU Operators COP3014 Dr. David Gaitros 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 copyright 2010 Dr. David Gaitros, FSU Increment and Decrement operators Unary increment operator ++; Unary decrement operator --; Operator placed before variable:...
View Full Document

Page1 / 12

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

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online