Computer Programming Basics – Quiz 01

In today’s world, technology is integrated into nearly every aspect of our lives. From smartphones to automation, coding powers the tools we use daily. While programming might seem like a skill reserved for developers, the truth is that everyone can benefit from learning the basics. Whether you’re a student, a business owner, or a professional in any field, understanding programming empowers you to make better decisions, solve problems, and stay ahead in the digital age.

Benefits of Learning Programming

Enhances Problem-Solving Skills
Programming teaches logical thinking and problem-solving, helping individuals break down complex issues into smaller, manageable steps.

Boosts Career Opportunities
Nearly every industry, from finance to healthcare, requires professionals with coding knowledge. Learning programming can open doors to high-paying job opportunities.

Improves Automation & Efficiency
Coding allows people to automate repetitive tasks, saving time and boosting productivity in personal and professional life.

Empowers Innovation
With programming, individuals can develop apps, websites, and solutions to address real-world challenges and bring innovative ideas to life.

Increases Cybersecurity Awareness
Understanding how programs work can help individuals recognize security vulnerabilities and protect their digital data better.

Multiple-Choice Questions (MCQs) Quiz on Basic Programming

1. What does HTML stand for?

  1. Hypertext Markup Language
  2. High-Level Text Machine Learning
  3. Hyper Transfer Machine Language
  4. Home Tool Modern Language
Show answer

✅ Answer: A) Hypertext Markup Language

2. What is the primary function of loops in programming?

  1. To store data
  2. To execute a block of code multiple times
  3. To define variables
  4. To print data to the screen
Show answer

✅ Answer: B) To execute a block of code multiple times

3. Which language is commonly used for web development?

  1. Python
  2. C++
  3. JavaScript
  4. Swift
Show answer

✅ Answer: C) JavaScript

4. What does ‘Python’ primarily refer to in programming?

  1. A snake species
  2. A scripting language
  3. A cloud storage system
  4. A database tool
Show answer

✅ Answer: B) A scripting language

5. In programming, what does ‘variable’ mean?

  1. A constant value
  2. A container for storing data
  3. A type of algorithm
  4. A hardware device
Show answer

✅ Answer: B) A container for storing data

6. What is the output of print(2 + 3 * 4) in Python?

  1. 20
  2. 14
  3. 24
  4. 15
Show answer

✅ Answer: B) 14

7. Which of the following is NOT a programming language?

  1. Java
  2. Swift
  3. HTML
  4. Photoshop
Show answer

✅ Answer: D) Photoshop

8. What is the purpose of CSS in web development?

  1. Creating databases
  2. Styling web pages
  3. Defining server configurations
  4. Writing backend code
Show answer

✅ Answer: B) Styling web pages

9. What does ‘Open Source’ software mean?

  1. Software is available for free, but with restricted access
  2. Software whose source code is freely available for modification
  3. Software created only for government use
  4. Software that does not require coding
Show answer

✅ Answer: B) Software whose source code is freely available for modification

10. Which programming language is most commonly used for artificial intelligence (AI)?

  1. PHP
  2. Python
  3. CSS
  4. Assembly
Show answer

✅ Answer: B) Python

11. 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

12. 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

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

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

✅ Answer: A) Kotlin

14. 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

15. 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

16. 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

17. 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

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

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

✅ Answer: C) 1

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

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

✅ Answer: A) Git

20. 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

21. Which programming language is known for its simplicity and readability?

  1. C++
  2. JavaScript
  3. Python
  4. Assembly
Show answer

✅ Answer: C) Python

22. What symbol is used to denote comments in Python?

  1. //
  2. #
  3. /* */
  4. --
Show answer

✅ Answer: B) #

23. What does the return statement do in a function?

  1. Stops the function execution
  2. Returns a value from the function
  3. Prints a message to the console
  4. Declares a new function
Show answer

✅ Answer: B) Returns a value from the function

24. Which of the following is NOT a valid data type in Python?

  1. String
  2. Integer
  3. Boolean
  4. Folder
Show answer

✅ Answer: D) Folder

25. What is the output of print(10 // 3) in Python?

  1. 3.33
  2. 3
  3. 3.0
  4. 10
Show answer

✅ Answer: B) 3

26. Which of the following is used to repeat a block of code a fixed number of times?

  1. if statement
  2. for loop
  3. function
  4. class
Show answer

✅ Answer: B) for loop

27. What does IDE stand for in programming?

  1. Integrated Development Environment
  2. Internet Data Explorer
  3. Interactive Debugging Engine
  4. Intelligent Data Extractor
Show answer

✅ Answer: A) Integrated Development Environment

28. Which of the following best describes an algorithm?

  1. A programming language
  2. A step-by-step process to solve a problem
  3. A storage device
  4. A web development framework
Show answer
  • ✅ Answer: B) A step-by-step process to solve a problem

29. In JavaScript, how do you write an array?

  1. {1, 2, 3}
  2. [1, 2, 3]
  3. (1, 2, 3)
  4. "1, 2, 3"
Show answer

✅ Answer: B) [1, 2, 3]

30. What is the correct way to declare a function in JavaScript?

  1. function myFunction() {}
  2. def myFunction()
  3. new function myFunction()
  4. func myFunction()
Show answer

✅ Answer: A) function myFunction() {}

31. What is the primary function of a database?

  1. Store and organize data
  2. Perform mathematical calculations
  3. Execute loops
  4. Define functions
Show answer

✅ Answer: A) Store and organize data

32. Which of the following is a popular database management system?

  1. Python
  2. MySQL
  3. C++
  4. JavaScript
Show answer

✅ Answer: B) MySQL

33. What does the && operators do in programming?

  1. Performs a logical AND operation
  2. Combines two functions
  3. Adds two numbers
  4. Declares a variable
Show answer

✅ Answer: A) Performs a logical AND operation

34. What keyword is used to define a constant variable in JavaScript?

  1. const
  2. var
  3. let
  4. fina
Show answer

✅ Answer: A) const

35. Which programming language is commonly used for game development?

  1. Swift
  2. C++
  3. SQL
  4. PHP
Show answer

✅ Answer: B) C++

36. What does CSS stand for?

  1. Computer System Syntax
  2. Cascading Style Sheets
  3. Creative Software Solutions
  4. Complex Script Styling
Show answer

✅ Answer: B) Cascading Style Sheets

37. What is the default file extension for JavaScript files?

  1. .js
  2. .java
  3. .script
  4. .txt
Show answer

✅ Answer: A) .js

38. What does the term “frontend” refer to in web development?

  1. The client-side of a website
  2. The database storage system
  3. Server configurations
  4. Backend programming logic
Show answer

✅ Answer: A) The client-side of a website

39. Which programming language is widely used for data science?

  1. Python
  2. HTML
  3. C
  4. Swift
Show answer

✅ Answer: A) Python

40. What is the purpose of an API in programming?

  1. To connect software applications
  2. To debug a program
  3. To store files
  4. To define variables
Show answer

✅ Answer: A) To connect software applications

41. What does the command git clone do in Git?

  1. Creates a new repository
  2. Copies an existing repository to your local system
  3. Deletes a repository
  4. Merges two repositories
Show answer

✅ Answer: B) Copies an existing repository to your local system

42. Which of the following is NOT a valid Python data type?

  1. List
  2. Tuple
  3. Boolean
  4. Element
Show answer

✅ Answer: D) Element

43. In Java, which keyword is used to create an object from a class?

  1. new
  2. object
  3. create
  4. class
Show answer

✅ Answer: A) new

44. What does the while loop do?

  1. Executes a block of code as long as a condition is true
  2. Stops the program execution
  3. Declares a function
  4. Defines a variable
Show answer

✅ Answer: A) Executes a block of code as long as a condition is true

45. What type of language is SQL?

  1. Scripting language
  2. Query language
  3. Object-oriented language
  4. Functional programming language
Show answer

✅ Answer: B) Query language

46. What does DOM stand for in web development?

  1. Document Object Model
  2. Data Output Manager
  3. Dynamic Online Mode
  4. Digital Object Memory
Show answer

✅ Answer: A) Document Object Model

47. Which of the following is used for responsive web design?

  1. Bootstrap
  2. Java
  3. C++
  4. Python
Show answer

✅ Answer: A) Bootstrap

48. What is the primary role of a software framework?

  1. Provides pre-written code to streamline development
  2. Stores database entries
  3. Designs hardware components
  4. Compiles programming languages
Show answer

✅ Answer: A) Provides pre-written code to streamline development

49. Which of the following is a popular JavaScript library?

  1. React
  2. MySQL
  3. Swift
  4. C#
show answer

✅ Answer: A) React

50. What does JSON stand for?

  1. JavaScript Object Notation
  2. Java System Output Name
  3. Java Secure Online Network
  4. Java Structured Object Naming
Show answer

✅ Answer: A) JavaScript Object Notation

Final Thoughts

Programming is not just for software engineers; it’s a valuable skill for everyone. Whether you’re automating tasks, building projects, or just improving problem-solving abilities, coding is a powerful tool that enhances productivity and creativity. Start small, explore different languages, and embrace the world of programming—it’s an investment in your future.

Scroll to Top