CMPSC 201 Chapter Notes - Chapter 3: Type Conversion, Order Of Operations, Operand

73 views4 pages
School
Course

Document Summary

Cin: standard input object prompt: question that tells user what data to enter cin >> length; Gathering input from the user is a 2 step process: use the cout object to display prompt on the screen, use cin object to read value from the keyboard. Must include iostream le in any for any program that uses cin. Entering multiple values: int whole; double fractional; char letter; cin >> whole >> fractional >> letter whole : 4. Multiple operands: the one with higher precedence works (bodmas) higher precedence: * . If they have same precedence, they work from left to right. If there is parenthesis, that is used rst. How to raise a number to the power: use pow and arguments (data being sent to the function) area = pow( 4. 0, 2. 0) The second number is raised to the power of the rst number.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents