What is a computer program?
A A hardware circuit
B A data cable
C A sequence of instructions
D A storage partition
Answer: C. A sequence of instructions. A program gives a computer ordered instructions for a task.
What is an algorithm?
A Finite ordered problem steps
B A programming language
C A memory address
D A user interface
Answer: A. Finite ordered problem steps. An algorithm describes steps to solve a problem and must eventually finish.
What does pseudocode provide?
A Language independent steps
B Executable machine code
C A hardware description
D A database schema
Answer: A. Language independent steps. Pseudocode expresses an algorithm without strict language syntax.
Which flowchart shape usually shows a decision?
A Rectangle
B Oval
C Parallelogram
D Diamond
Answer: D. Diamond. A diamond represents a branching decision such as yes or no.
What is source code?
A A compiled executable
B Human readable program text
C A processor register
D A disk partition
Answer: B. Human readable program text. Source code is written in a programming language for people to read and modify.
What does a compiler generally do?
A Stores source files
B Designs a processor
C Translates source code
D Draws flowcharts
Answer: C. Translates source code. A compiler translates source code into another form, often machine code or bytecode.
How does an interpreter commonly run code?
A Fabricates processor chips
B Stores variables permanently
C Executes instructions during translation
D Converts data to voltage
Answer: C. Executes instructions during translation. An interpreter executes program instructions as it processes the source or intermediate form.
A syntax error violates what?
A Language grammar rules
B Program purpose
C Memory capacity
D Network protocol
Answer: A. Language grammar rules. Syntax errors occur when code breaks the language's grammatical rules.
A logic error causes what?
A Invalid punctuation only
B A damaged processor
C Incorrect program result
D A missing keyboard
Answer: C. Incorrect program result. Logic errors let a program run but produce an unintended result.
What is debugging?
A Compressing source files
B Finding and fixing defects
C Translating speech
D Allocating network ports
Answer: B. Finding and fixing defects. Debugging is the process of locating and correcting program defects.
What does a variable represent?
A Named changeable value
B Fixed hardware pin
C Program comment
D Compiler warning
Answer: A. Named changeable value. A variable associates a name with a value that can change during execution.
What is a constant in a program?
A Fixed program value
B A temporary loop counter
C An input device
D A changing array index
Answer: A. Fixed program value. A constant represents a value the program treats as fixed.
What is an identifier?
A A numeric operator
B Program element name
C A file format
D A control-flow branch
Answer: B. Program element name. Identifiers name items such as variables, functions, and types.
What does variable declaration usually specify?
A Loop and condition
B Input and output
C File and folder
D Name and type
Answer: D. Name and type. A declaration introduces a variable and often specifies its type.
What is initialization?
A Deleting a variable
B Renaming a function
C Giving an initial value
D Starting a computer
Answer: C. Giving an initial value. Initialization assigns a starting value when a variable is created or used.
Which data type commonly stores whole numbers?
A Boolean
B Integer
C Character
D Floating point
Answer: B. Integer. Integer types represent whole-number values.
Which type represents true or false?
A String
B Boolean
C Integer
D Character
Answer: B. Boolean. A Boolean value has the logical states true and false.
Which type commonly stores one symbol?
A Integer
B Character
C Boolean
D Array
Answer: B. Character. A character type represents a single character in many languages.
Which type stores decimal numeric values?
A Boolean
B Character
C Pointer
D Floating point
Answer: D. Floating point. Floating point types represent fractional values with limited precision.
What is type conversion?
A Changing a value's representation type
B Sorting an array
C Repeating a loop
D Opening a file
Answer: A. Changing a value's representation type. Type conversion changes how a value is represented as a data type.
What does variable scope determine?
A How fast a CPU runs
B How files are sorted
C Which key is pressed
D Where a name is accessible
Answer: D. Where a name is accessible. Scope defines the region of a program where an identifier can be used.
What is a reserved keyword?
A A word with language meaning
B A user chosen file name
C A comment marker
D A numeric constant only
Answer: A. A word with language meaning. Keywords such as if or return have predefined meanings and usually cannot be identifiers.
What do comments primarily do?
A Change program output
B Allocate memory
C Call a function
D Explain code to readers
Answer: D. Explain code to readers. Comments document code and are generally ignored during execution.
What does an IDE commonly combine?
A CPU and memory chips
B Router and modem
C Monitor and keyboard
D Editor and development tools
Answer: D. Editor and development tools. An IDE often combines code editing, building, debugging, and project tools.
Why divide a program into modules?
A To increase syntax errors
B To remove all variables
C To organize related functionality
D To prevent testing
Answer: C. To organize related functionality. Modules group related code and make programs easier to understand and maintain.