LDP-1 MCQ Reference Ques
LDP-1 MCQ Reference Ques
a) Processing data
b) Storing data
c) Inputting data
d) All of the above
Answer: d) All of the above
a) RAM
b) CPU
c) Hard Drive
d) Monitor
Answer: b) CPU
3. What is the full form of CPU?
4. In a basic block diagram of a computer system, which component stores data and
programs?
a) CPU
b) Input Unit
c) Memory Unit
d) Output Unit
Answer: c) Memory Unit
a) Keyboard
b) Mouse
c) Monitor
d) Scanner
Answer: c) Monitor
6. The software that allows the computer to interact with hardware is called:
a) Application software
b) System software
c) Utility software
d) Development software
Answer: b) System software
7. Which of the following is not considered computer hardware?
a) Printer
b) Monitor
c) Operating system
d) Keyboard
Answer: c) Operating system
a) Interpreter
b) Compiler
c) Assembler
d) Loader
Answer: b) Compiler
a) Binary code
b) Assembly language
c) High-level language
d) Pseudo code
Answer: a) Binary code
a) Keyboard
b) Mouse
c) Printer
d) Scanner
Answer: c) Printer
a) Assembly language
b) Machine language
c) Pseudo code
d) English
Answer: b) Machine language
13. Which part of the computer is responsible for arithmetic and logical operations?
a) Input Unit
b) ALU (Arithmetic Logic Unit)
c) Control Unit
d) Output Unit
Answer: b) ALU (Arithmetic Logic Unit)
a) User-specific
b) Provides an interface for users
c) Manages hardware resources
d) Performs a specific task for a user
Answer: c) Manages hardware resources
a) C
b) Python
c) Assembly language
d) Java
Answer: c) Assembly language
a) To store data
b) To perform calculations
c) To control the flow of data between CPU and peripherals
d) To manage memory
Answer: c) To control the flow of data between CPU and peripherals
a) ALU
b) Printer
c) Control Unit
d) Motherboard
Answer: b) Printer
19. Which of the following converts source code written in assembly language to
machine code?
a) Assembler
b) Compiler
c) Interpreter
d) Linker
Answer: a) Assembler
a) Machine language
b) Assembly language
c) Human language
d) Binary code
Answer: c) Human language
a) Python
b) Assembler
c) Binary
d) C++
Answer: c) Binary
24. A program that translates high-level programming language into machine language
line by line is called:
a) Compiler
b) Interpreter
c) Assembler
d) Debugger
Answer: b) Interpreter
a) RAM
b) Motherboard
c) CPU
d) Hard Disk
Answer: c) CPU
a) Microsoft Word
b) Operating System
c) Photoshop
d) Chrome
Answer: b) Operating System
a) Compilation
b) Interpretation
c) Assembly
d) Execution
Answer: c) Assembly
a) Storing data
b) Performing calculations
c) Accepting data from the user
d) Displaying results
Answer: c) Accepting data from the user
a) Hardware
b) Firmware
c) Application software
d) Peripheral device
Answer: b) Firmware
Unit-2 - Introduction to Logic Building:
2. Which type of logic deals with statements that are either true or false?
a) Predicate logic
b) Boolean logic
c) Propositional logic
d) Fuzzy logic
Answer: c) Propositional logic
a) Expression
b) Predicate
c) Variable
d) Bit
Answer: d) Bit
a) ADD
b) AND
c) INCREMENT
d) MULTIPLY
Answer: b) AND
a) &
b) |
c) ¬
d) →
Answer: c) ¬
a) OR
b) NOT
c) AND
d) IF
Answer: d) IF
a) Variables
b) Propositions
c) Predicates
d) Functions
Answer: a) Variables
a) A AND B
b) A OR B
c) NOT A
d) TRUE OR FALSE
Answer: d) TRUE OR FALSE
a) A + B
b) A - B
c) A && B
d) A // B
Answer: c) A && B
13. What is the main difference between propositional logic and predicate logic?
a) Predicate logic includes variables and quantifiers, propositional logic does not
b) Propositional logic includes variables, predicate logic does not
c) Predicate logic is simpler than propositional logic
d) Propositional logic includes loops, predicate logic does not
Answer: a) Predicate logic includes variables and quantifiers, propositional logic does not
14. In Boolean logic, which of the following statements is true for the expression "A OR
B"?
a) To write code
a) Oval
b) Rectangle
c) Diamond
d) Parallelogram
Answer: b) Rectangle
a) Input/output
b) Start/End
c) Decision
d) Process
Answer: c) Decision
19. Which flowchart symbol is used to represent the start or end of a process?
a) Oval
b) Diamond
c) Rectangle
d) Parallelogram
Answer: a) Oval
a) Decision-making
b) Input/output operations
c) Process steps
d) Loops
d) Indicate loops
a) Diamond
b) Parallelogram
d) Oval
a) By using a parallelogram
a) Arrow
b) Rectangle
c) Circle
d) Diamond
Answer: c) Circle
26. When translating a real-world problem into a flowchart, what is the first step?
c) Decide on loops
d) Hardware connections
b) A decision point
a) Rectangle
b) Diamond
c) Parallelogram
d) Trapezoid
Answer: d) Trapezoid
32. When is it appropriate to use a flowchart?
a) It must be complex
c) Recursion
a) Definiteness
b) Finiteness
c) Ambiguity
d) Input
Answer: c) Ambiguity
d) Debugging
a) A programming language
c) Machine code
d) A type of error in programming
a) Dynamic programming
c) Greedy method
d) Linear search
40. Which of the following is true about the greedy algorithm design paradigm?
b) It builds the solution step by step, choosing the best option at each step
Answer: b) It builds the solution step by step, choosing the best option at each step
Answer: b) To solve each subproblem only once and store the results
42. Which of the following is NOT a part of algorithm design?
d) Writing pseudocode
44. Which of the following problem-solving strategies involves solving the simplest
subproblem first and using its solution in solving the more complex problem?
b) Greedy method
c) Recursion
d) Dynamic programming
Answer: a) The algorithm must take finite time and produce a result
Unit-3 - Fundamentals of C:
a) Platform-independent
b) Object-oriented
c) Mid-level language
d) Interpreted language
a) .cpp
b) .c
c) .java
d) .exe
Answer: b) .c
a) scanf()
b) cout
c) printf()
d) print()
Answer: c) printf()
4. The #include directive in C is used for:
a) Including libraries
b) Declaring functions
d) Commenting lines
b) To display output
a) /* Comment */
b) // Comment
c) # Comment
d) % Comment
Answer: b) // Comment
a) int
b) char
c) float
d) real
Answer: d) real
a) #define
b) const
c) final
d) Both a and b
a) 1 byte
b) 2 bytes
c) 4 bytes
d) 8 bytes
Answer: c) 4 bytes
a) +
b) =
c) *
d) ()
Answer: d) ()
13. Which of the following is a valid variable name in C?
a) 1stValue
b) value_1
c) int
d) #value
Answer: b) value_1
14. What is the default data type of a real number like 5.3 in C?
a) float
b) double
c) int
d) long double
Answer: b) double
a) ==
b) =
c) +=
d) ||
Answer: b) =
16. The result of the expression 10 % 3 is:
a) 3
b) 0
c) 1
d) 7
Answer: c) 1
17. What is the output of the following expression 5 / 2 when both operands are
integers?
a) 2.5
b) 2
c) 3
d) Undefined
Answer: b) 2
a) printf()
b) input()
c) scanf()
d) cin
Answer: c) scanf()
a) Left to right
b) Right to left
c) Both directions
a) int
b) float
c) double
d) long double
a) 3.14
b) 'A'
c) "Hello"
d) 1
Answer: a) 3.14
a) =
b) ==
c) !=
d) &&
Answer: b) ==
a) 1 byte
b) 2 bytes
c) 4 bytes
d) 8 bytes
Answer: a) 1 byte
a) 26
b) 16
c) 12
d) 20
Answer: b) 16
26. Which function is used to output a single character in C?
a) printf()
b) putchar()
c) gets()
d) puts()
Answer: b) putchar()
Copy code
printf("%d", 5 + 3 * 2);
a) 10
b) 16
c) 11
d) 21
Answer: a) 10
29. Which of the following is a valid way to declare a constant integer variable in C?
c) #define x 10
30. Which of the following correctly shows the precedence of arithmetic operators in
decreasing order?
a) +, -, *, /, %
b) *, /, %, +, -
c) +, *, %, -, /
d) /, +, -, *, %
Answer: b) *, /, %, +, -
a) typedef
b) #define
c) const
d) static
Answer: b) #define
32. What will the scanf("%d", &var); function do in a C program?
Answer: b) Store a value entered by the user into the variable var
33. What is the correct syntax for using the increment operator in C?
a) var+
b) ++var
c) var+1
d) var+var
Answer: b) ++var
34. What does the expression 5 > 3 && 4 < 2 evaluate to?
a) True
b) False
c) Undefined
d) Syntax error
Answer: b) False