CSS Computer Science (Optional) — Paper-I, Section-A, Topic II subtopic. Foundational vocabulary used throughout programming.
Core Concepts
- Algorithm: a finite, ordered sequence of unambiguous steps to solve a problem. Must be finite, definite, effective, and produce output from given input.
- Program: an algorithm expressed in a programming language that a computer can execute
- Syntax: the grammatical rules of a language; a syntax error breaks compilation
- Semantics: the meaning of a valid statement; a logic error compiles fine but produces wrong results
- Keyword/Reserved word: words with predefined meaning in a language (e.g.
if, while, return) that can't be used as identifiers
- Identifier: a programmer-chosen name for a variable, function, or other entity — must start with a letter/underscore, no spaces, case-sensitive, cannot match a keyword
- Literal/Constant: a fixed value written directly in code (e.g.
10, 3.14, 'A', "hello") — never changes during execution
- Operator: a symbol that performs an operation on operand(s) — arithmetic (
+ - * / %), relational (== != < >), logical (&& || !), assignment (= += -=), bitwise (& | ^ ~ << >>)
- Operand: the value(s) an operator acts upon
- Expression: a combination of operands and operators that evaluates to a single value (e.g.
a + b * 2)
- Statement: a complete instruction, terminated appropriately (e.g.
; in C/C++). Building block of a program — one or more statements form a function body.
- Token: the smallest individual unit of a program recognized by the compiler — keywords, identifiers, literals, operators, and punctuators are all tokens
- Comment: non-executable text for human readers, ignored by the compiler/interpreter (
// single-line, /* */ multi-line in C/C++)
The 5 Fundamental Elements of a Program
Every program, in every language, is built from five basic elements. Each one also has a standard flowchart shape and a typical pseudocode form, so you can move between "what it does," "how it's drawn," and "how it's written" for each:
| # |
Element |
What It Does |
Flowchart Shape |
Pseudocode Form |
| 1 |
Input |
Brings data into the program from the user/file/device |
Parallelogram |
READ x / INPUT x |
| 2 |
Output |
Sends a result out to the user/file/device |
Parallelogram |
WRITE result / PRINT result |
| 3 |
Operation (Processing) |
Performs a computation, assignment, or data transformation |
Rectangle |
total = price * qty |
| 4 |
Condition (Selection) |
Branches the flow based on a true/false test |
Diamond |
IF x > 0 THEN ... ELSE ... ENDIF |
| 5 |
Looping (Iteration) |
Repeats a block of steps while/until a condition holds |
Diamond, with a backward arrow looping to an earlier step |
WHILE x < 10 DO ... ENDWHILE |
- Input and Output share the same shape (parallelogram) — the direction of data is shown by the flow/arrow and wording, not a different symbol
- Looping has no shape of its own — it reuses the diamond (decision) for the repeat-test, plus an arrow that loops back to an earlier step instead of moving forward