C Programming: Tokens, Operators, and Logic
Classified in Computers
Written at on English with a size of 2.55 KB.
Tokens
In programming, a token is the smallest meaningful element in code. They are the building blocks of a language's syntax. Common token types include:
- Keywords: Reserved words like
if
,else
,while
, andint
(for declaring integers). - Identifiers: Names given to elements like variables (e.g.,
sum
), functions, and arrays. - Constants: Unchanging values during program execution (e.g.,
3.14
for pi). - Operators: Symbols for mathematical or logical operations (e.g.,
+
for addition). - Separators: Punctuation like commas (
,
), semicolons (;
), and braces ({}
).
Example: int sum = 10 + 5;
In this line, int
is a keyword, sum
is an identifier, =
is an operator, 10
and 5
are constants, and ;
is a separator.
Arithmetic Operators
C has nine arithmetic operators for basic... Continue reading "C Programming: Tokens, Operators, and Logic" »