1
This section covers programming fundamentals — tokens, data types, variables, constants, operators, formatted/unformatted I/O, structured vs object-oriented programming, and algorithms & flowcharts.
2
Tokens, Data Types & Variables A token is the smallest individual unit of a program — keywords, identifiers, constants, operators, and punctuation/special symbols (comments are stripped out and are NOT tokens).
3
Common data types: int (integers), float/double (decimals), char (single character), void (no value).
4
A variable is a named memory location whose value can change; declared as type name;
5
Numeric (e.g., 25, 3.14), Character (e.g., 'A'), String (e.g., "Hello") — values that do not change during execution.
6
Operators Category Examples Arithmetic + − * / % (modulus) Assignment = += −= *= /= Relational / Comparison == != < > <= >= Logical && (AND) || (OR) ! (NOT) Input & Output Statements Formatted I/O (e.g., printf()/scanf() in C): uses format specifiers — %d (int), %f (float), %c (char), %s (string).
7
Unformatted I/O (e.g., getchar()/putchar(), gets()/puts()): reads/writes raw characters or strings without format conversion.
8
Structured vs Object-Oriented Programming Paradigm Approach Structured programming Program organized top-down around functions/procedures that operate on separately declared data (e.g., C) Object-oriented programming (OOP) Data and the functions that operate on it are bound together into objects/classes (e.g., C++, Java) Algorithms & Flowcharts An algorithm is a finite, step-by-step procedure for solving a problem, independent of any programming language.
9
A flowchart represents an algorithm graphically using standard symbols: oval (start/end), rectangle (process), diamond (decision), parallelogram (input/output).