Skip to content

Variables, types, and arithmetic · ⁨变量、类型与算术⁩

English

Every value has a type

  • In C, every variable has a type that says what kind of value it holds.
  • The three you use most: int (a whole number), double (a number with a decimal point), and char (a single character).
  • You must give the type when you create the variable: int n = 5; or double pi = 3.14;.
中文

每个值都有类型

  • 在 C 里,每个变量都有一个类型,说明它存放的是哪种值。
  • 最常用的三种:int(整数)、double(带小数点的数)、char(单个字符)。
  • 创建变量时必须写出类型:int n = 5; 或 double pi = 3.14;。

Handout

Log in or create account · ⁨登录或创建账户⁩

IGCSE, A-Level · ⁨IGCSE、A-Level⁩ & AP · ⁨与 AP⁩