Fundamentals of Programming Quiz: Test Your Coding Basics – Set 02

Ready to take the next step in your coding journey? After mastering the core fundamentals in Set 01, it’s time to sharpen your logic and deepen your understanding.

This second set of the Computer Programming Basics Quiz is designed to challenge your grasp of programming logic and foundational structures. Whether you are a student preparing for exams or a self-taught learner building a solid base, these questions will help you bridge the gap between “knowing” and “applying.”

Multiple-Choice Questions (MCQs) Quiz on Basic Programming

1. Which of the following is used to store multiple values in a single variable?

  1. Array
  2. Function
  3. Loop
  4. Condition
Show answer

✅ Answer: A) Array

2. What is the function of an if statement in programming?

  1. To loop through a block of code
  2. To define a variable
  3. To execute code based on a condition
  4. To display output on the screen
Show answer

✅ Answer: C) To execute code based on a condition

3. Which programming language is primarily used for mobile app development?

  1. Kotlin
  2. SQL
  3. C++
  4. HTML
Show answer

✅ Answer: A) Kotlin

4. What does the print() function do in Python?

  1. Prints a document
  2. Displays text or output to the console
  3. Creates a file
  4. Deletes a variable
Show answer

✅ Answer: B) Displays text or output to the console

5. Which of the following is NOT a type of loop in programming?

  1. While
  2. Do-While
  3. For
  4. Execute
Show answer

✅ Answer: D) Execute

6. In JavaScript, how do you declare a variable?

  1. var x = 5;
  2. variable x = 5;
  3. let x = 5;
  4. Both A and C
Show answer

✅ Answer: D) Both A and C

7. What does SQL stand for?

  1. Structured Query Language
  2. Software Query Logic
  3. System Query Locator
  4. Stored Quick Language
Show answer

✅ Answer: A) Structured Query Language

8. What is the output of 5 % 2 in programming?

  1. 2
  2. 2.5
  3. 1
  4. 0
Show answer

✅ Answer: C) 1

9. Which of the following is a version control system?

  1. Git
  2. Java
  3. Swift
  4. Apache
Show answer

✅ Answer: A) Git

10. What is the purpose of a function in programming?

  1. To store data
  2. To execute a block of code when called
  3. To define loops
  4. To print values
Show answer

✅ Answer: B) To execute a block of code when called

More Quizzes in the Fundamentals Series

Scroll to Top