- 3
- 0
- 约 97页
- 2017-04-28 发布于四川
- 举报
第二章数据类型运算符和表达式[完整]
第2章 数据类型、运算符与表达式;本章学习内容;C Program Structure;例2.1:一个简单的C程序例子 ;C程序常见符号分类 ;C程序常见符号分类 ;标识符命名 ;何谓变量(Variable )?;如何衡量变量所占空间大小?;一个位有多大?
只能是“0”或者“1”,二进制
一个字节有多大?
可以表示数字0~255之间的整数
保存一个字符(英文字母、数字、符号)
ASCII(美国标准信息交换码)编码(附录A);Needs to be declared:
变量类型 变量名;;变量声明(Variable Declaration);Example:
int number1, number2;
number1 = 25;
number2 = 23;
number1 = number2;
…
… ;Algorithm
变量 ? 表达式
Syntax
变量 = 表达式 ;
Rules:类型一致
Expression’s type must be the same as variable’s type
;Example:
Calculate and display the price of a number of apples if the quantity in kg and price per kg
原创力文档

文档评论(0)