Sample questions
Question 1Easy
C, C++ and Java are examples of
- Machine languages
- High-level languages
- Assembly language programs
- Query languages
Answer: B. High-level languages
Explanation
High-level languages use English-like syntax and are third generation (3GL).
Step-by-step solution
- High-level languages use English-like syntax and are third generation (3GL).
- So the answer is: High-level languages.
Why the other options are wrong
- A. Machine language is binary.
- C. Assembly uses mnemonics.
- D. Query languages are used for data.
Question 2Easy
A program that translates the whole source code into machine code before execution is a
- Compiler
- Interpreter
- Assembler
- Editor
Answer: A. Compiler
Explanation
A compiler translates the whole program first, and then the machine code runs.
Step-by-step solution
- A compiler translates the whole program first, and then the machine code runs.
- So the answer is: Compiler.
Why the other options are wrong
- B. An interpreter runs line by line.
- C. An assembler converts assembly.
- D. An editor writes the code.
Question 3Easy
Which generation of programming language is machine language?
- Second generation
- Third generation
- Fourth generation
- First generation
Answer: D. First generation
Explanation
Machine language uses binary code and is the first-generation language (1GL).
Step-by-step solution
- Machine language uses binary code and is the first-generation language (1GL).
- So the answer is: First generation.
Why the other options are wrong
- A. Assembly language is second.
- B. High-level languages are third.
- C. SQL-like languages are fourth.
Question 4Easy
Assembly language is which generation of language?
- Second generation
- First generation (1GL)
- Third generation (3GL)
- Fifth generation (5GL)
Answer: A. Second generation
Explanation
Assembly language uses mnemonics such as ADD and MOV. It is 2GL.
Step-by-step solution
- Assembly language uses mnemonics such as ADD and MOV.
- It is 2GL.
- So the answer is: Second generation.
Why the other options are wrong
- B. Machine language is first.
- C. High-level languages are third.
- D. Fifth is AI or logic-based.
Question 5Medium
An error caused by violating the grammar rules of a language is a
- Logical error
- Syntax error
- Runtime error
- Semantic error in output only
Answer: B. Syntax error
Explanation
A syntax error stops compilation. Fix the code according to language rules.
Step-by-step solution
- A syntax error stops compilation.
- Fix the code according to language rules.
- So the answer is: Syntax error.
Why the other options are wrong
- A. A logical error gives wrong output.
- C. A runtime error happens during execution.
- D. Semantic errors relate to meaning.
Question 6Medium
Dividing by zero at run time causes
- A syntax error
- A compile-time error
- No error ever
- A runtime error
Answer: D. A runtime error
Explanation
Runtime errors occur during execution, for example division by zero.
Step-by-step solution
- Runtime errors occur during execution, for example division by zero.
- So the answer is: A runtime error.
Why the other options are wrong
- A. Division by zero is valid syntax.
- B. The compiler does not check values at run time.
- C. It does produce an error.
Question 7Medium
- High-level code into assembly
- Machine code into C
- Assembly language into machine code
- Java into Python
Answer: C. Assembly language into machine code
Explanation
An assembler translates mnemonics to machine instructions.
Step-by-step solution
- An assembler translates mnemonics to machine instructions.
- So the answer is: Assembly language into machine code.
Why the other options are wrong
- A. That is the compiler.
- B. This is a disassembler direction.
- D. Not an assembler task.
Question 8Medium
Which program combines object files and libraries into an executable?
- Loader
- Debugger
- Editor
- Linker
Answer: D. Linker
Explanation
The linker resolves references among object modules and libraries to form an executable.
Step-by-step solution
- The linker resolves references among object modules and libraries to form an executable.
- So the answer is: Linker.
Why the other options are wrong
- A. A loader puts the program into memory.
- B. A debugger finds errors.
- C. An editor writes code.
Question 9Hard
Which language is mainly used for artificial intelligence and was created by John McCarthy in 1958?
- LISP
- COBOL
- FORTRAN
- Ada
Answer: A. LISP
Explanation
LISP was designed for symbolic computation and AI research.
Step-by-step solution
- LISP was designed for symbolic computation and AI research.
- So the answer is: LISP.
Why the other options are wrong
- B. COBOL is for business.
- C. FORTRAN is for science.
- D. Ada is for safety-critical systems.
Tip: The clues 'artificial intelligence' and John McCarthy point to LISP, designed for symbolic computation; check the creator clue.
Question 10Hard
The word "bug" in debugging was popularised by
- Ada Lovelace
- Dennis Ritchie
- Grace Hopper
- Alan Turing
Answer: C. Grace Hopper
Explanation
Grace Hopper's team found a moth in a relay of Harvard Mark II in 1947, which popularised the term debugging.
Step-by-step solution
- Grace Hopper's team found a moth in a relay of Harvard Mark II in 1947, which popularised the term debugging.
- So the answer is: Grace Hopper.
Why the other options are wrong
- A. Lovelace wrote the first algorithm.
- B. Ritchie created C.
- D. Turing worked on theory.
Tip: The 'bug' anecdote (a moth found in a relay) is linked to Grace Hopper; match the famous story to the right person.
Practise all 25 questions free
The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.
Open this topic in the app →