1 / 183
文档名称:

【工具辅导类】C++ By Example(二).pdf

格式:pdf   页数:183
下载后只包含 1 个 PDF 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

【工具辅导类】C++ By Example(二).pdf

上传人:中国课件站 2011/7/19 文件大小:0 KB

下载得到文件列表

【工具辅导类】C++ By Example(二).pdf

文档介绍

文档介绍:Part II
Using C++ Operators
C++ By
EXAMPLE8
Using C++ Math
Operators and
Precedence
If you are dreading this chapter because you don’t like math—relax,
C++ does all your math for you! It is a misconception that you have
to be good at math to understand how to puters. In
fact, programming practice assumes the opposite is true! Your
computer is your “slave,” to follow your instructions, and to do all
the calculations for you. This chapter explains how C++ computes
by introducing you to
♦ Primary math operators
♦ Order of operator precedence
♦ Assignment statements
♦ Mixed data type calculations
♦ Type casting
163
Chapter 8 ♦ Using C++ Math Operators and Precedence
Many people who dislike math actually enjoy learning how the
computer handles it. After learning the math operators and a few
simple ways in which C++ uses them, you should fortable
using calculations in your programs. Computers are fast, and they
can perform math operations much faster than you can!
C++’s Primary Math
Operators
A C++ math operator is a symbol used for adding, subtracting,
multiplying, dividing, and other operations. C++ operators are not
always mathematical in nature, but many are. Table lists these
operator symbols and their primary meanings.
Table . C++ primary operators.
Symbol Meaning
* Multiplication
/ Division and Integer Division
% Modulus or Remainder
+ Addition
- Subtraction
Most of these operators work in the familiar way you expect
them to. Multiplication, addition, and subtraction produce the same
results (and the division operator usually does) as those produced
with a calculator. Table illustrates four of these simple operators.
Table . Typical operator results.
Formula Result
4 * 2 8
64 / 4 16
80 - 15 65
12 + 9 21
164
C++ By
EXAMPLE
Table contains examples of binary operations performed with
the four operators. Don’t confuse binary operations with binary
numb

最近更新

2024年广东省外语艺术职业学院单招职业倾向性.. 41页

2024年广东碧桂园职业学院单招职业倾向性考试.. 39页

2024年广东茂名幼儿师范专科学校单招职业适应.. 40页

2024年广州体育职业技术学院单招职业技能测试.. 40页

2024年广西城市职业大学单招综合素质考试模拟.. 39页

2024年广西工程职业学院单招职业技能测试题库.. 40页

2024年广西省贵港市单招职业适应性测试题库推.. 39页

2024年庆阳职业技术学院单招职业倾向性考试题.. 40页

2024年德州科技职业学院单招职业技能考试题库.. 40页

2024年忻州职业技术学院单招职业倾向性测试题.. 41页

2024年惠州城市职业学院单招职业技能考试题库.. 40页

2024年承德护理职业学院单招职业适应性考试模.. 41页

2024年攀枝花攀西职业学院单招职业倾向性考试.. 41页

2024年无锡南洋职业技术学院单招职业技能测试.. 40页

2024年日照航海工程职业学院单招综合素质考试.. 40页

2024年明达职业技术学院单招职业适应性测试题.. 40页

2024年景德镇陶瓷职业技术学院单招职业倾向性.. 40页

2024年杭州科技职业技术学院单招职业倾向性考.. 41页

2024年枣庄职业学院单招职业技能考试题库附答.. 40页

2024年梧州医学高等专科学校单招职业适应性考.. 40页

2024年武汉警官职业学院单招职业适应性考试题.. 40页

2024年永州师范高等专科学校单招职业倾向性考.. 41页

2025年重庆市《保安员证》考试题库含答案 39页

预防滑倒、绊倒及跌落专题培训课件 45页

混凝土工程培训课件优秀PPT 26页

小学数学六年级下册《鸽巢问题》作业设计 9页

住院患者自带药品使用管理规定通知 3页

个人检讨反思(向管理服务对象借钱) 5页

花卉学课件7 花卉的栽培管理 79页

GA T 1585-2019《法庭科学 尸体检验摄像技术规.. 8页