Introduction to Programming MCQs with Answers
Practice important Introduction to Programming MCQs with answers and explanations.
Chapter: 2
Q21:
What is the purpose of utility software?
A. Perform a specific task related to managing system resources
B. Manages hardware
C. Allocates memory
D. All of the above
Correct Answer:
A
Chapter: 2
Q22:
What does the Disk Compression utility do?
A. Compresses files to reduce their size
B. Defragments files
C. Stores files in fragmented form
D. Decompresses files when requested
Correct Answer:
A
Chapter: 2
Q23:
Which of the following is NOT a task of the operating system?
A. Resource allocation
B. Scheduling
C. Data management
D. Device management
Correct Answer:
D
Chapter: 2
Q24:
What is the benefit of using an interpreter?
A. Errors are found as you go along
B. Programs execute faster
C. Syntax errors are automatically corrected
D. All errors are corrected automatically
Correct Answer:
A
Chapter: 2
Q25:
What is the purpose of a compiler?
A. Translate code into machine language
B. Translate code into human language
C. Execute code directly
D. Stop execution on errors
Correct Answer:
A
Chapter: 2
Q26:
What is a debugger used for?
A. To write code
B. To debug code
C. To manage memory
D. To trace logical errors
Correct Answer:
D
Chapter: 2
Q27:
What does a linker do?
A. Links object code with libraries
B. Compiles code
C. Translates code
D. Includes necessary routines
Correct Answer:
A
Chapter: 2
Q28:
What is the role of a loader?
A. Executes the program
B. Links object code with libraries
C. Saves the program on disk
D. Starts the execution from the main function
Correct Answer:
D
Chapter: 2
Q29:
What language was C language developed from?
A. BCPL
B. B
C. Fortran
D. ALGOL
Correct Answer:
A
Chapter: 2
Q30:
Who developed the C language?
A. Ken Thompson
B. Dennis Ritchie
C. Martin Richards
D. Brian Kernighan
Correct Answer:
B
Chapter: 2
Q31:
What is the difference between an interpreter and a compiler?
A. An interpreter translates line by line
B. A compiler translates line by line
C. An interpreter translates the whole program at once
D. A compiler translates the whole program at once
Correct Answer:
A
Chapter: 2
Q32:
Which organization standardized the C language?
A. ISO
B. ANSI
C. NIST
D. IEEE
Correct Answer:
B
Chapter: 2
Q33:
What is the purpose of a text editor in programming?
A. Writing code
B. Translating code
C. Formatting code
D. Saving code
Correct Answer:
A
Chapter: 2
Q34:
Which tool is used to check and correct logical errors in a program?
A. Compiling code
B. Debugging code
C. Linking code
D. Executing code
Correct Answer:
B
Chapter: 2
Q35:
Which tool is used to load a program into memory for execution?
A. Compiling code
B. Storing code
C. Executing code
D. Linking code
Correct Answer:
D
Chapter: 3
Q36:
#include is a ___________ in C programming.
A. function
B. variable
C. pre-processor directive
D. loop
Correct Answer:
C
Chapter: 3
Q37:
The main function in C is executed ________.
A. first
B. after all other functions
C. only if called
D. none of the above
Correct Answer:
A
Chapter: 3
Q38:
What is the output of the following code: cout << 'Welcome to Virtual University of Pakistan';?
A. Displays Welcome to Virtual University of Pakistan on the screen
B. Displays Welcome to the screen
C. Displays Virtual University of Pakistan on the screen
D. Displays nothing
Correct Answer:
A
Chapter: 3
Q39:
Which of the following is used to store whole numbers in C?
A. int
B. char
C. float
D. double
Correct Answer:
A
Chapter: 3
Q40:
What is the size of int data type in C?
A. 2 bytes
B. 4 bytes
C. 1 byte
D. 8 bytes
Correct Answer:
B