College of Technology
Silver Oak College of Engineering and Technology
Bachelor of Technology
Computer Engineering
Semester: 1st Academic Year: 2024-25
Course Name: Logic Development Course Code: 2010043113
with Programming-1
LDP-1 MCQ’s QUESTION FOR REFERENCE-
Unit-1 - Introduction to Computer System:
1. What is the basic function of a computer system?
a) Processing data
b) Storing data
c) Inputting data
d) All of the above
Answer: d) All of the above
2. Which component of the computer is responsible for executing instructions?
a) RAM
b) CPU
c) Hard Drive
d) Monitor
Answer: b) CPU
3. What is the full form of CPU?
a) Central Process Unit
b) Central Processing Unit
c) Control Processing Unit
d) Central Power Unit
Answer: b) Central Processing Unit
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
5. Which of the following is an output device?
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
8. Which type of software converts high-level language code to machine code?
a) Interpreter
b) Compiler
c) Assembler
d) Loader
Answer: b) Compiler
9. What is the primary function of an interpreter?
a) It compiles the entire program at once
b) It translates and executes code line by line
c) It manages hardware resources
d) It connects hardware to the CPU
Answer: b) It translates and executes code line by line
10. Machine-level programming languages are written using:
a) Binary code
b) Assembly language
c) High-level language
d) Pseudo code
Answer: a) Binary code
11. Which of the following is not an input device?
a) Keyboard
b) Mouse
c) Printer
d) Scanner
Answer: c) Printer
12. A compiler converts a high-level language into:
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)
14. What does RAM stand for?
a) Read Access Memory
b) Random Application Memory
c) Random Access Memory
d) Read-Only Memory
Answer: c) Random Access Memory
15. Which of the following is a characteristic of system software?
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
16. Which programming language is closest to machine language?
a) C
b) Python
c) Assembly language
d) Java
Answer: c) Assembly language
17. What is the role of a control unit in a computer system?
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
18. Which of the following is an example of computer 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
20. High-level programming languages are closer to:
a) Machine language
b) Assembly language
c) Human language
d) Binary code
Answer: c) Human language
21. What does ROM stand for?
a) Random Output Memory
b) Read-Only Memory
c) Read-On Memory
d) Random Operational Memory
Answer: b) Read-Only Memory
22. Which of the following is used to write machine-level code?
a) Python
b) Assembler
c) Binary
d) C++
Answer: c) Binary
23. Which of the following is NOT a storage device?
a) Hard disk
b) SSD
c) Keyboard
d) USB drive
Answer: c) Keyboard
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
25. Which device is considered the "brain" of the computer?
a) RAM
b) Motherboard
c) CPU
d) Hard Disk
Answer: c) CPU
26. Which of the following is an example of system software?
a) Microsoft Word
b) Operating System
c) Photoshop
d) Chrome
Answer: b) Operating System
27. Which language is considered machine-independent?
a) Machine language
b) Assembly language
c) High-level language
d) Binary code
Answer: c) High-level language
28. The process of converting assembly code to machine code is called:
a) Compilation
b) Interpretation
c) Assembly
d) Execution
Answer: c) Assembly
29. A computer's input unit is responsible for:
a) Storing data
b) Performing calculations
c) Accepting data from the user
d) Displaying results
Answer: c) Accepting data from the user
30. The BIOS in a computer system is an example of:
a) Hardware
b) Firmware
c) Application software
d) Peripheral device
Answer: b) Firmware
Unit-2 - Introduction to Logic Building:
1. Why is logic important in problem-solving?
a) It reduces the need for algorithms
b) It helps to break down complex problems into manageable steps
c) It increases program complexity
d) It avoids mathematical thinking
Answer: b) It helps to break down complex problems into manageable steps
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
3. What is the basic unit of Boolean logic?
a) Expression
b) Predicate
c) Variable
d) Bit
Answer: d) Bit
4. Which of the following is an example of a Boolean operator?
a) ADD
b) AND
c) INCREMENT
d) MULTIPLY
Answer: b) AND
5. In propositional logic, which symbol is used to represent the "NOT" operation?
a) &
b) |
c) ¬
d) →
Answer: c) ¬
6. Which of the following is NOT a Boolean operator?
a) OR
b) NOT
c) AND
d) IF
Answer: d) IF
7. In predicate logic, what is used to represent objects or subjects?
a) Variables
b) Propositions
c) Predicates
d) Functions
Answer: a) Variables
8. Algorithmic thinking involves:
a) Executing a predefined set of operations
b) Structuring a problem into a series of steps
c) Memorizing code
d) Avoiding abstraction in problem-solving
Answer: b) Structuring a problem into a series of steps
9. Which Boolean expression evaluates to TRUE for any input values?
a) A AND B
b) A OR B
c) NOT A
d) TRUE OR FALSE
Answer: d) TRUE OR FALSE
10. The logical operator "AND" produces which result?
a) TRUE if both operands are TRUE
b) TRUE if one operand is TRUE
c) TRUE if both operands are FALSE
d) TRUE if at least one operand is FALSE
Answer: a) TRUE if both operands are TRUE
11. What is the purpose of an algorithm in logic building?
a) To solve logical puzzles
b) To define the steps for solving a problem
c) To test hardware
d) To increase code efficiency
Answer: b) To define the steps for solving a problem
12. Which of the following represents a valid Boolean expression?
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) It is TRUE only if both A and B are TRUE
b) It is FALSE only if both A and B are FALSE
c) It is always FALSE
d) It is always TRUE
Answer: b) It is FALSE only if both A and B are FALSE
15. Which step should be taken first in algorithmic thinking?
a) Write the code
b) Identify the problem
c) Test the solution
d) Debug the algorithm
Answer: b) Identify the problem
16. What is the primary purpose of a flowchart?
a) To write code
b) To represent the flow of control in a process or system
c) To test hardware components
d) To calculate complex mathematical equations
Answer: b) To represent the flow of control in a process or system
17. Which flowchart symbol is used to represent a process or action step?
a) Oval
b) Rectangle
c) Diamond
d) Parallelogram
Answer: b) Rectangle
18. The diamond symbol in a flowchart represents:
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
20. What does the parallelogram symbol in a flowchart represent?
a) Decision-making
b) Input/output operations
c) Process steps
d) Loops
Answer: b) Input/output operations
21. In a flowchart, arrows are used to:
a) Define the direction of flow
b) Represent a process step
c) Mark start and end points
d) Indicate loops
Answer: a) Define the direction of flow
22. What is one of the main advantages of using a flowchart?
a) It automatically generates code
b) It provides a visual representation of a problem-solving process
c) It simplifies code debugging
d) It ensures faster code execution
Answer: b) It provides a visual representation of a problem-solving process
23. Which flowchart symbol is used for a predefined process or subroutine?
a) Diamond
b) Parallelogram
c) Rectangle with double vertical bars
d) Oval
Answer: c) Rectangle with double vertical bars
24. How is a loop typically represented in a flowchart?
a) By using a parallelogram
b) By creating a decision point with arrows looping back
c) By using multiple rectangles
d) By connecting two ovals
Answer: b) By creating a decision point with arrows looping back
25. Which of the following is NOT a typical flowchart symbol?
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?
a) Identify the inputs and outputs
b) Code the solution
c) Decide on loops
d) Identify errors in the system
Answer: a) Identify the inputs and outputs
27. A flowchart can help in understanding:
a) The syntax of a programming language
b) The structure of a code
c) The logic and sequence of operations in a process
d) Hardware connections
Answer: c) The logic and sequence of operations in a process
28. Which of the following problems is best solved using a flowchart?
a) Complex mathematical equations
b) Visualization of program logic
c) Debugging syntax errors
d) Data storage optimization
Answer: b) Visualization of program logic
29. In flowchart conventions, what does the connector symbol (circle) typically
represent?
a) A break in the flow
b) A decision point
c) A jump to another part of the flowchart
d) The end of the process
Answer: c) A jump to another part of the flowchart
30. How are multiple steps in sequence represented in a flowchart?
a) Using multiple decision symbols
b) By connecting several rectangles with arrows
c) Using one parallelogram
d) Using one oval symbol
Answer: b) By connecting several rectangles with arrows
31. Which symbol is used to represent manual input in a flowchart?
a) Rectangle
b) Diamond
c) Parallelogram
d) Trapezoid
Answer: d) Trapezoid
32. When is it appropriate to use a flowchart?
a) When writing final code
b) When planning and designing algorithms
c) During the debugging phase
d) After the code is compiled
Answer: b) When planning and designing algorithms
33. What is the primary purpose of an algorithm?
a) To solve a mathematical problem
b) To provide a solution in the shortest time
c) To define a sequence of steps to solve a problem
d) To execute code faster
Answer: c) To define a sequence of steps to solve a problem
34. Which of the following is a key characteristic of a good algorithm?
a) It must be complex
b) It must provide ambiguous instructions
c) It must terminate after a finite number of steps
d) It must require maximum memory
Answer: c) It must terminate after a finite number of steps
35. Which of the following is an algorithm design paradigm?
a) Divide and Conquer
b) Brute Force
c) Recursion
d) All of the above
Answer: d) All of the above
36. Which one of the following is NOT a characteristic of an algorithm?
a) Definiteness
b) Finiteness
c) Ambiguity
d) Input
Answer: c) Ambiguity
37. When designing an algorithm, which step comes first?
a) Writing the code
b) Translating the problem into pseudocode
c) Understanding and defining the problem
d) Debugging
Answer: c) Understanding and defining the problem
38. What is pseudocode?
a) A programming language
b) A high-level description of an algorithm
c) Machine code
d) A type of error in programming
Answer: b) A high-level description of an algorithm
39. In problem-solving strategies, which technique involves breaking down a problem
into smaller subproblems?
a) Dynamic programming
b) Divide and Conquer
c) Greedy method
d) Linear search
Answer: b) Divide and Conquer
40. Which of the following is true about the greedy algorithm design paradigm?
a) It always gives the optimal solution
b) It builds the solution step by step, choosing the best option at each step
c) It solves problems recursively
d) It is slower than other algorithms
Answer: b) It builds the solution step by step, choosing the best option at each step
41. What is the goal of dynamic programming?
a) To solve problems by brute force
b) To solve each subproblem only once and store the results
c) To find the fastest possible solution
d) To write complex code
Answer: b) To solve each subproblem only once and store the results
42. Which of the following is NOT a part of algorithm design?
a) Identifying the problem
b) Debugging the program
c) Designing the solution
d) Writing pseudocode
Answer: b) Debugging the program
43. How does an algorithm differ from a program?
a) An algorithm is a step-by-step procedure, while a program is its implementation in
code
b) A program is a logical sequence, while an algorithm is just a flowchart
c) An algorithm is written in a specific programming language
d) There is no difference between an algorithm and a program
Answer: a) An algorithm is a step-by-step procedure, while a program is its
implementation in code
44. Which of the following problem-solving strategies involves solving the simplest
subproblem first and using its solution in solving the more complex problem?
a) Divide and Conquer
b) Greedy method
c) Recursion
d) Dynamic programming
Answer: d) Dynamic programming
45. Translating a real-world problem into an algorithm requires:
a) Understanding the problem requirements and constraints
b) Directly writing the code
c) Skipping the problem statement
d) Using a flowchart only
Answer: a) Understanding the problem requirements and constraints
46. When writing pseudocode, which of the following is NOT required?
a) Syntax of a specific programming language
b) Clarity in describing each step
c) Sequential flow of operations
d) Definitions of variables and inputs
Answer: a) Syntax of a specific programming language
47. What is the main advantage of using pseudocode in algorithm development?
a) It is faster than writing code
b) It simplifies the process of converting an algorithm into a program
c) It requires detailed syntax knowledge
d) It is an exact representation of the final program
Answer: b) It simplifies the process of converting an algorithm into a program
48. What does "finiteness" mean in the context of an algorithm?
a) The algorithm must take finite time and produce a result
b) The algorithm can have infinite loops
c) The algorithm must require infinite input
d) The algorithm must be written in a finite number of languages
Answer: a) The algorithm must take finite time and produce a result
Unit-3 - Fundamentals of C:
1. Which of the following is a feature of C language?
a) Platform-independent
b) Object-oriented
c) Mid-level language
d) Interpreted language
Answer: c) Mid-level language
2. What is the correct extension of a C program file?
a) .cpp
b) .c
c) .java
d) .exe
Answer: b) .c
3. Which function is used to print output in 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
c) Including user-defined variables
d) Commenting lines
Answer: a) Including libraries
5. Which of the following is the correct structure of a C program?
a) Functions -> Variables -> main()
b) Header files -> main() -> Functions
c) Variables -> Functions -> Header files
d) Header files -> Functions -> main()
Answer: b) Header files -> main() -> Functions
6. In C, what is the purpose of a comment?
a) To include header files
b) To display output
c) To make code executable
d) To improve code readability
Answer: d) To improve code readability
7. How do you declare a single-line comment in C?
a) /* Comment */
b) // Comment
c) # Comment
d) % Comment
Answer: b) // Comment
8. Which of the following is NOT a data type in C?
a) int
b) char
c) float
d) real
Answer: d) real
9. Which of the following is used to declare a constant in C?
a) #define
b) const
c) final
d) Both a and b
Answer: d) Both a and b
10. What is the size of an int data type in C (typically on a 32-bit machine)?
a) 1 byte
b) 2 bytes
c) 4 bytes
d) 8 bytes
Answer: c) 4 bytes
11. What is the purpose of the void keyword in C?
a) To declare a variable with no type
b) To indicate a function returns no value
c) To represent an integer value
d) To stop program execution
Answer: b) To indicate a function returns no value
12. In C, which operator has the highest precedence?
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
15. Which of the following operators is used to assign a value to a variable?
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
18. Which function is used to take input from the user in C?
a) printf()
b) input()
c) scanf()
d) cin
Answer: c) scanf()
19. Which of the following is true about type conversion in C?
a) Implicit type conversion happens automatically by the compiler
b) Type conversion can only be done manually
c) There is no type conversion in C
d) Type conversion leads to syntax errors
Answer: a) Implicit type conversion happens automatically by the compiler
20. What is the associativity of the assignment operator = in C?
a) Left to right
b) Right to left
c) Both directions
d) None of the above
Answer: b) Right to left
21. Which data type can store the largest value in C?
a) int
b) float
c) double
d) long double
Answer: d) long double
22. Which of the following is used to denote a floating-point constant in C?
a) 3.14
b) 'A'
c) "Hello"
d) 1
Answer: a) 3.14
23. Which operator is used for equality checking in C?
a) =
b) ==
c) !=
d) &&
Answer: b) ==
24. What is the size of a char data type in C?
a) 1 byte
b) 2 bytes
c) 4 bytes
d) 8 bytes
Answer: a) 1 byte
25. The expression 10 + 3 * 2 is evaluated as:
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()
27. What is the output of the following statement?
Copy code
printf("%d", 5 + 3 * 2);
a) 10
b) 16
c) 11
d) 21
Answer: a) 10
28. What does the term "typecasting" refer to in C?
a) Changing the data type of a variable during execution
b) Automatically assigning values
c) Converting one data type into another
d) Making variables constant
Answer: c) Converting one data type into another
29. Which of the following is a valid way to declare a constant integer variable in C?
a) int const x = 10;
b) const int x = 10;
c) #define x 10
d) All of the above
Answer: d) All of the above
30. Which of the following correctly shows the precedence of arithmetic operators in
decreasing order?
a) +, -, *, /, %
b) *, /, %, +, -
c) +, *, %, -, /
d) /, +, -, *, %
Answer: b) *, /, %, +, -
31. Which of the following is used to define symbolic constants in C?
a) typedef
b) #define
c) const
d) static
Answer: b) #define
32. What will the scanf("%d", &var); function do in a C program?
a) Print the value of var
b) Store a value entered by the user into the variable var
c) Assign a default value to var
d) Terminate the 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