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 ตัวแปรแต่ละตัวมี type ที่บอกประเภทของค่าที่มันเก็บไว้
  • สามอย่างที่คุณใช้บ่อยที่สุด: int (จำนวนเต็ม), double (ทศนิยม), และ char (ตัวอักษรเดียว)
  • คุณต้องระบุ type เมื่อสร้างตัวแปร: int n = 5; หรือ double pi = 3.14;

Handout · ⁨เอกสารประกอบการเรียน⁩

Log in or create account · ⁨เข้าสู่ระบบหรือสร้างบัญชี⁩

IGCSE, A-Level & AP