Introduction to Programming MCQs

1. Which of the following is a high-level programming language? A) Assembly language B) Machine language C) C++ D) Binary code Answer: C) C++ 2. The process of finding and correcting errors in a program is called: A) Debugging B) Compiling C) Executing D) Interpreting Answer: A) Debugging 3. Which of the following is NOT a programming language? A) HTML B) CSS C) Java D) JPEG Answer: D) JPEG 4. Which programming language is known as the “mother of all languages”? A) Fortran B) COBOL C) Assembly language D) C Answer: A) Fortran 5. The process of converting source code into machine code is called: A) Compiling B) Debugging C) Interpreting D) Executing Answer: A) Compiling 6. Which of the following is an example of a procedural programming language? A) Python B) C++ C) Haskell D) SQL Answer: B) C++ 7. What is the primary purpose of comments in a program? A) To make the program more readable for humans B) To instruct the computer on what to do C) To hide parts of the code from execution D) To speed up the execution of the program Answer: A) To make the program more readable for humans 8. Which data type is used to store whole numbers in most programming languages? A) float B) double C) int D) char Answer: C) int 9. Which symbol is used for single-line comments in many programming languages? A) // B) /* */ C) # D) ‘ Answer: A) // 10. In object-oriented programming, what is an object? A) A function B) A variable C) An instance of a class D) A conditional statement Answer: C) An instance of a class 11. Which of the following is NOT a fundamental programming control structure? A) Sequence B) Iteration C) Case D) Function Answer: D) Function 12. Which of the following operators is used for exponentiation in many programming languages? A) ^ B) ** C) % D) & **Answer: B) **** 13. Which of the following is an example of a compiled programming language? A) Python B) JavaScript C) C# D) PHP Answer: C) C# 14. Which type of error in programming causes a program to terminate abnormally? A) Syntax error B) Runtime error C) Logic error D) Compilation error Answer: B) Runtime error 15. Which of the following is NOT a valid variable name in most programming languages? A) my_variable B) 123variable C) _variable D) variable123 Answer: B) 123variable 16. What is the term for a predefined action or set of actions that perform a specific task? A) Algorithm B) Function C) Variable D) Statement Answer: B) Function 17. Which programming paradigm emphasizes the use of functions to break down problems into smaller parts? A) Procedural programming B) Object-oriented programming C) Functional programming D) Logical programming Answer: A) Procedural programming 18. What does the acronym “IDE” stand for in programming? A) Integrated Design Environment B) Integrated Development Environment C) Integrated Debugging Environment D) Intelligent Development Environment Answer: B) Integrated Development Environment 19. Which of the following is an example of a statically-typed programming language? A) Python B) JavaScript C) Java D) Ruby Answer: C) Java 20. Which of the following is NOT a primitive data type in programming? A) String B) Integer C) Boolean D) Float Answer: A) String 21. What is the purpose of conditional statements in programming? A) To repeat a block of code multiple times B) To execute a block of code only if a certain condition is true C) To define a function D) To define a variable Answer: B) To execute a block of code only if a certain condition is true 22. Which of the following is an example of a logical operator in programming? A) + B) && C) = D) ; Answer: B) && 23. In programming, what is the term for a named storage location that holds a value? A) Function B) Variable C) Object D) Array Answer: B) Variable 24. Which of the following is used to represent a single character in many programming languages? A) string B) char C) character D) txt Answer: B) char 25. What is the purpose of loops in programming? A) To check for errors in the code B) To execute a block of code repeatedly C) To display output to the user D) To stop the execution of the program Answer: B) To execute a block of code repeatedly 26. Which of the following is an example of a relational operator in programming? A) <> B) ++ C) :: D) -> Answer: A) <> 27. What does the term “DRY” stand for in programming? A) Don’t Repeat Yourself B) Do Repeat Yourself C) Duplicate Reuse Yield D) Define Replace Yield Answer: A) Don’t Repeat Yourself 28. Which of the following is an example of an object-oriented programming language? A) C B) Python C) Perl D) Assembly language Answer: B) Python 29. What is the purpose of arrays in programming? A) To store multiple values of the same data type B) To perform mathematical calculations C) To define functions D) To control the flow of execution Answer: A) To store multiple values of the same data type 30. Which of the following symbols is used for assignment in programming? A) = B) == C) := D) -> Answer: A) = 31. In object-oriented programming, what is inheritance? A) The process of creating new objects B) The process of defining a new class C) The process of reusing existing classes D) The process of compiling code Answer: C) The process of reusing existing classes 32. Which of the following is NOT a valid way to declare a variable in many programming languages? A) var x; B) int x; C) x = 5; D) x = int; Answer: D) x = int; 33. What is the purpose of encapsulation in object-oriented programming? A) To hide the implementation details of an object B) To create new objects C) To define functions D) To perform mathematical operations Answer: A) To hide the implementation details of an object 34. Which of the following is an example of a functional programming language? A) Python B) Haskell C) C++ D) Ruby Answer: B) Haskell 35. Which of the following operators is used to combine two or more conditions in programming? A) & B) || C) ! D) : Answer: B) || 36. What is the term for a named section of a program that performs a specific task? A) Algorithm B) Function C) Variable D) Statement Answer: B) Function 37. Which of the following is an example of a dynamic typing programming language? A) Java B) C# C) Python D) C++ Answer: C) Python 38. What is the purpose of the “if…else” statement in programming? A) To execute a block of code repeatedly B) To define a function C) To execute a block of code only if a certain condition is true, otherwise execute another block D) To define a variable Answer: C) To execute a block of code only if a certain condition is true, otherwise execute another block 39. Which of the following is an example of a bitwise operator in programming? A) && B) || C) & D) ! Answer: C) & 40. What is the term for a predefined action or set of actions that perform a specific task? A) Algorithm B) Function C) Variable D) Statement Answer: B) Function 41. Which of the following is NOT a valid programming language? A) Python B) Java C) HTML D) PHP Answer: C) HTML 42. Which of the following operators is used for exponentiation in many programming languages? A) ^ B) ** C) % D) & **Answer: B) **** 43. Which type of error in programming causes a program to terminate abnormally? A) Syntax error B) Runtime error C) Logic error D) Compilation error Answer: B) Runtime error 44. Which of the following is NOT a valid variable name in most programming languages? A) my_variable B) 123variable C) _variable D) variable123 Answer: B) 123variable 45. What is the term for a predefined action or set of actions that perform a specific task? A) Algorithm B) Function C) Variable D) Statement Answer: B) Function 46. Which of the following is an example of a procedural programming language? A) Python B) C++ C) Haskell D) SQL Answer: B) C++ 47. Which of the following is NOT a fundamental programming control structure? A) Sequence B) Iteration C) Case D) Function Answer: D) Function 48. Which programming language is known as the “mother of all languages”? A) Fortran B) COBOL C) Assembly language D) C Answer: A) Fortran 49. Which of the following is a high-level programming language? A) Assembly language B) Machine language C) C++ D) Binary code Answer: C) C++ 50. The process of finding and correcting errors in a program is called: A) Debugging B) Compiling C) Executing D) Interpreting Answer: A) Debugging

More MCQS on Electronics MCQs

  1. Physical Chemistry MCQs
  2. General Chemistry MCQs
  3. Chemistry MCQs
  4. Modern Physics MCQs
  5. Waves and Optics MCQs
  6. Electromagnetism MCQs
  7. Mechanics MCQs
  8. Physics MCQs
  9. Optoelectronics MCQs
  10. Wireless Communications MCQs
  11. Network Security MCQs
  12. Artificial Intelligence and Machine Learning MCQs
  13. Internet of Things (IoT) MCQs
  14. Robotics MCQs
  15. Software Engineering MCQs
  16. Embedded Systems Programming MCQs
  17. Computer Architecture MCQs
  18. Data Structures and Algorithms MCQs
  19. Introduction to Programming MCQs
  20. Renewable Energy Systems MCQs
  21. Power Systems MCQs
  22. Biomedical Electronics MCQs
  23. Telecommunications Engineering MCQs
  24. Photonics MCQs
  25. Nanotechnology MCQs
  26. Semiconductor Devices MCQs
  27. RF and Microwave Engineering MCQs
  28. Digital Signal Processing (DSP) MCQs
  29. VLSI Design (Very-Large-Scale Integration) MCQs
  30. Embedded Systems MCQs
  31. Power Electronics MCQs
  32. Control Systems MCQs
  33. Analog and Digital Communication Systems MCQs
  34. Microprocessors and Microcontrollers MCQs
  35. Electromagnetic Fields and Waves MCQs
  36. Signals and Systems MCQs
  37. Digital Logic Design MCQs
  38. Electronics MCQs
  39. Electronics MCQs

Leave a Comment

All copyrights Reserved by MCQsAnswers.com - Powered By T4Tutorials