Guided Notes

Variables, Data Types & Constants

Declaring variables, the basic data types and their sizes, format specifiers, type conversion, and constants.

Variables

Slide 1 / 5

A variable is a named location in memory with a fixed type: int age = 36; float price = 9.99f; char grade = 'A';

• Declare before use; you can declare and assign later: int count; count = 5; • Names may contain letters, digits, and underscores, and can't start with a digit. • C is case-sensitive: total and Total are different. • An uninitialized local variable holds garbage — always give variables a value before reading them.

← Introduction to C