Subject Wise MCQs

COMPUTER SCIENCE MCQs

Practice COMPUTER SCIENCE multiple-choice questions online. Test your knowledge with solved MCQs, check correct answers and review explanations for better exam preparation.

49 Total MCQs
20 Questions on this page
2 Current page

COMPUTER SCIENCE Practice Questions

Select an option and check your answer to test your knowledge.

COMPUTER SCIENCE Computer Instructor BPS-17 AJKPSC Solved Past Paper 2019 MCQS
21

Which of the following is the incorrect statement?

View Correct Answer & Explanation
Correct Answer: B. An array is a collection of variables
Explanation:

An array is a collection of elements of the same data type. Its individual elements can be accessed using an index. Therefore, the statement that an array is simply a collection of variables is considered incorrect in this context.

COMPUTER SCIENCE Computer Instructor BPS-17 AJKPSC Solved Past Paper 2019 MCQS
22

Which of the following is not a type of variable?

View Correct Answer & Explanation
Correct Answer: D. None of the above
Explanation:

Extern and register are storage-related classifications in C/C++, while global describes a variable with global scope. Therefore, none of the listed choices is excluded as a variable type or classification.

COMPUTER SCIENCE Computer Instructor BPS-17 AJKPSC Solved Past Paper 2019 MCQS
23

Which of the following is the symbol for the AND operator?

View Correct Answer & Explanation
Correct Answer: B. &&
Explanation:

The && operator is the logical AND operator in C and C++. It returns true when both conditions are true. The single & symbol is the bitwise AND operator.

COMPUTER SCIENCE Computer Instructor BPS-17 AJKPSC Solved Past Paper 2019 MCQS
24

While coding in C/C++, for "Call by Reference" we pass:

View Correct Answer & Explanation
Correct Answer: A. Address of variable
Explanation:

In traditional C, call by reference is achieved by passing the address of a variable using a pointer. In C++, references can also be used to allow a function to operate directly on the original variable.

COMPUTER SCIENCE Computer Instructor BPS-17 AJKPSC Solved Past Paper 2019 MCQS
25

Which of the following is the correct statement?

View Correct Answer & Explanation
Correct Answer: A. Variable name must start with an underscore or letter
Explanation:

In C/C++, an identifier such as a variable name must begin with a letter or underscore. It may contain letters, digits, and underscores afterward, but it cannot contain whitespace or be a reserved keyword.

COMPUTER SCIENCE Computer Instructor BPS-17 AJKPSC Solved Past Paper 2019 MCQS
26

In C/C++ Programming, "a" is used for:

View Correct Answer & Explanation
Correct Answer: D. Alarm
Explanation:

In C and C++, \a is an escape sequence that produces an alert or alarm character. On systems that support it, this may produce an audible beep or other alert.

COMPUTER SCIENCE Computer Instructor BPS-17 AJKPSC Solved Past Paper 2019 MCQS
27

In C/C++ Programming, the strcmp() function is used to:

View Correct Answer & Explanation
Correct Answer: C. Compare two Strings
Explanation:

The strcmp() function in C/C++ compares two null-terminated strings character by character. It returns 0 when the strings are equal, a negative value when the first string is smaller, and a positive value when the first string is larger.

COMPUTER SCIENCE Computer Instructor BPS-17 AJKPSC Solved Past Paper 2019 MCQS
28

A time-sharing system implies:

View Correct Answer & Explanation
Correct Answer: C. More than one program in memory
Explanation:

A time-sharing system allows multiple users or programs to share CPU time. Multiple programs are kept in memory, and the CPU rapidly switches among them to provide interactive execution. It does not require multiple processors.

COMPUTER SCIENCE Computer Instructor BPS-17 AJKPSC Solved Past Paper 2019 MCQS
29

When there is enough memory to fit a process in memory, but the space is not contiguous, we need:

View Correct Answer & Explanation
Correct Answer: C. External Fragmentation
Explanation:

External Fragmentation occurs when enough total free memory is available to satisfy a process request, but the free space is scattered across separate non-contiguous blocks. Therefore, the process cannot be allocated despite sufficient total free memory.

COMPUTER SCIENCE Computer Instructor BPS-17 AJKPSC Solved Past Paper 2019 MCQS
30

Which memory allocation policy allocates the largest hole to the process?

View Correct Answer & Explanation
Correct Answer: B. Worst-Fit
Explanation:

Worst-Fit is a memory allocation strategy that searches for and allocates the largest available free memory block, or hole, to a process. It is intended to leave relatively large remaining holes for future allocations.

COMPUTER SCIENCE Computer Instructor BPS-17 AJKPSC Solved Past Paper 2019 MCQS
31

Divided logical memory into blocks with the same size as frames are called:

View Correct Answer & Explanation
Correct Answer: A. Pages
Explanation:

In paging, logical memory is divided into fixed-size blocks called pages, while physical memory is divided into fixed-size blocks called frames. Pages and frames have the same size, allowing pages to be mapped to available frames.

COMPUTER SCIENCE Computer Instructor BPS-17 AJKPSC Solved Past Paper 2019 MCQS
32

Bringing a page into memory only when it is needed is called:

View Correct Answer & Explanation
Correct Answer: A. Demand Paging
Explanation:

Demand Paging is a virtual memory technique in which pages are loaded into physical memory only when they are needed. If a required page is not currently in memory, a page fault occurs and the operating system loads the page from secondary storage.

COMPUTER SCIENCE Computer Instructor BPS-17 AJKPSC Solved Past Paper 2019 MCQS
33

Page-Table Length Register (PTLR) indicates the size of:

View Correct Answer & Explanation
Correct Answer: A. Page Table
Explanation:

The Page-Table Length Register (PTLR) indicates the size or length of the page table. It helps determine the number of entries present in the page table for a process.

COMPUTER SCIENCE Computer Instructor BPS-17 AJKPSC Solved Past Paper 2019 MCQS
34

Paging is implemented in:

View Correct Answer & Explanation
Correct Answer: A. Operating System
Explanation:

Paging is a memory-management scheme used by the operating system to divide logical memory into fixed-size pages and physical memory into fixed-size frames. The operating system manages the mapping between pages and frames using page tables.

COMPUTER SCIENCE Computer Instructor BPS-17 AJKPSC Solved Past Paper 2019 MCQS
35

Which scheduler selects which processes should be brought into the ready queue?

View Correct Answer & Explanation
Correct Answer: B. Long-Term
Explanation:

The Long-Term Scheduler, also called the Job Scheduler, controls the degree of multiprogramming by selecting processes from the job pool and admitting them into the ready queue. The Short-Term Scheduler selects a process from the ready queue for CPU execution, while the Mid-Term Scheduler is mainly involved in swapping processes in and out of memory.

COMPUTER SCIENCE Computer Instructor BPS-17 AJKPSC Solved Past Paper 2019 MCQS
36

Which of the following is NOT an approach to handling deadlocks?

View Correct Answer & Explanation
Correct Answer: D. Virtual Memory
Explanation:

Deadlock Prevention, Deadlock Avoidance, and Deadlock Detection & Recovery are standard methods for handling deadlocks. Virtual Memory deals with memory management by allowing processes to use virtual address space beyond available physical memory.

COMPUTER SCIENCE IBA JST Solved MCQs 10 April 2026
37

Among the following options, which are the five main components of a communication system?

View Correct Answer & Explanation
Correct Answer: A. Message, Sender, Receiver, Medium, Protocol
Explanation:

A communication system commonly involves a sender, message, receiver, communication medium, and protocol. The protocol provides rules for how the communication takes place.

COMPUTER SCIENCE IBA JST Solved MCQs 10 April 2026
38

If you are asked to classify computers based on their size, which of the following options correctly represents this classification?

View Correct Answer & Explanation
Correct Answer: C. Mainframe, Minicomputer, Supercomputer, Microcomputer
Explanation:

Computers can traditionally be classified by size and processing capability into categories such as supercomputers, mainframes, minicomputers, and microcomputers.

COMPUTER SCIENCE IBA JST Solved MCQs 10 April 2026
39

From the following options, which computing device belongs to the first generation of computers?

View Correct Answer & Explanation
Correct Answer: B. Electronic Numerical Integrator and Calculator (ENIAC)
Explanation:

ENIAC was an early electronic general-purpose computer and is classified among first-generation computers, which primarily used vacuum tubes.

COMPUTER SCIENCE IBA JST Solved MCQs 10 April 2026
40

Which one of the following could be a line of code from Machine Language programming?

View Correct Answer & Explanation
Correct Answer: D. 10101110111101111
Explanation:

Machine language consists of instructions represented in binary form, using 0s and 1s. The other options represent higher-level or assembly-style programming.

Back to All Past Paper MCQs