IT Jobs Computer Science MCQs with Answers

179 practice MCQs on Computer Science for IT Jobs tests. Think of your answer first, then open "Show answer and explanation". These are practice questions, not official examination papers.

Take a timed Computer Science quiz: Free account required to save your score.

Q131. Which loop is guaranteed to execute at least once?

  1. while
  2. for
  3. do-while
  4. foreach
Show answer and explanation

Correct answer: C. do-while

do-while checks the condition after the body.

Q132. How many bits are in an IPv6 address?

  1. 128
  2. 64
  3. 256
  4. 32
Show answer and explanation

Correct answer: A. 128

IPv6 addresses are 128 bits.

Q133. Which device is used to scan documents?

  1. Modem
  2. Scanner
  3. Printer
  4. Speaker
Show answer and explanation

Correct answer: B. Scanner

A scanner digitises documents.

Q134. What is the extension of a C++ source file?

  1. .cpp
  2. .c
  3. .cs
  4. .cc only
Show answer and explanation

Correct answer: A. .cpp

.cpp is the common C++ extension.

Q135. What is the index of the first element in most programming languages?

  1. 0
  2. 2
  3. -1
  4. 1
Show answer and explanation

Correct answer: A. 0

Arrays are zero-indexed in C, Java and Python.

Q136. What does .gov represent in a domain?

  1. Group
  2. Government
  3. General
  4. Gaming
Show answer and explanation

Correct answer: B. Government

.gov is for government sites.

Q137. What is a nibble?

  1. 16 bits
  2. 8 bits
  3. 4 bits
  4. 2 bits
Show answer and explanation

Correct answer: C. 4 bits

A nibble is half a byte.

Q138. Which device connects devices within a LAN using MAC addresses?

  1. Router
  2. Switch
  3. Repeater
  4. Modem
Show answer and explanation

Correct answer: B. Switch

A switch forwards frames by MAC address.

Q139. What is the process of restarting a computer called?

  1. Logoff
  2. Shutdown
  3. Sleep
  4. Reboot
Show answer and explanation

Correct answer: D. Reboot

A reboot restarts the system.

Q140. Which function prints output in Python?

  1. echo
  2. print()
  3. printf()
  4. cout
Show answer and explanation

Correct answer: B. print()

Python uses print().

Other subjects

Looking for a job? Apply while you prepare: browse the latest government and private jobs on PK JOBs Hub.