Computer Science MCQs | Computer Science Multiple Choice Questions with Answers

Questions
1 How many different equivalence relations with exactly three different equivalence classes are there on a set with five elements ?
A 10
B 15
C 25
D 30

Answer: Option [A]
2 The number of different spanning trees in complete graph, K4 and bipartite graph, K2, 2 have ______ and _______ respectively.
A 14, 14
B 16, 14
C 16, 4
D 14, 4

Answer: Option [B]
3 Suppose that R1 and R2 are reflexive relations on a set A. Which of the following statements is correct ?
A R1 ∩ R2 is reflexive and R1 ∪ R2 is irreflexive
B R1 ∩ R2 is irreflexive and R1 ∪ R2 is reflexive
C Both R1 ∩ R2 and R1 ∪ R2 are reflexive
D Both R1 ∩ R2 and R1 ∪ R2 are irreflexive

Answer: Option [D]
4 There are three cards in a box. Both sides of one card are black, both sides of one card are red, and the third card has one black side and one red side. We pick a card at random and observe only one side. What is the probability that the opposite side is the same colour as the one side we observed ?
A 3/4
B 2/3
C 1/2
D 1/3

Answer: Option [A]
5 Which of the following logic expressions is incorrect ?
A 1 ⊕ 0 = 1
B 1 ⊕ 1 ⊕ 1 = 1
C 1 ⊕ 1 ⊕ 0 = 1
D 1 ⊕ 1 = 0

Answer: Option [B]
6 The IEEE-754 double-precision format to represent floating point numbers, has a length of _____ bits.
A 16
B 32
C 48
D 64

Answer: Option [B]
7 The simplified form of a Boolean equation (A – B + A – BC + AC) ( – A – C + – B) is :
A A – B
B A – BC
C – AB
D ABC

Answer: Option [B]
8 In a positive-edge-triggered JK flip-flop, if J and K both are high then the output will be _____ on the rising edge of the clock.
A No change
B Set
C Reset
D Toggle

Answer: Option [B]
9 Given i = 0, j = 1, k = –1 x = 0.5, y = 0.0 What is the output of the following expression in C language ? x * y < i + j || k
A -1
B 0
C 1
D 2

Answer: Option [B]
10 The following statement in ‘C’ int (*f())[ ]; declares
A Every context-sensitive language is recursive
B a function returning an array of pointers to integers
C array of functions returning pointers to integers
D an illegal statement

Answer: Option [B]
11 Which one of the following is correct, when a class grants friend status to another class ?
A The member functions of the class generating friendship can access the members of the friend class
B All member functions of the class granted friendship have unrestricted access to the members of the class granting the friendship
C Class friendship is reciprocal to each other
D There is no such concept

Answer: Option [A]
12 When a method in a subclass has the same name and type signatures as a method in the superclass, then the method in the subclass _____ the method in the superclass.
A Overloads
B Friendships
C Inherits
D Overrides

Answer: Option [B]
13 What is the value returned by the function f given below when n = 100 ? int f (int n) { if (n = = 0) then return n; else return n + f(n-2);
A 2550
B 2556
C 5220
D 5520

Answer: Option [D]
14 In RDBMS, the constraint that no key attribute (column) may be NULL is referred to as :
A Referential integrity
B Multi-valued dependency
C Entity Integrity
D Functional dependency

Answer: Option [A]
15 In a relational database model, NULL values can be used for all but which one of the following ?
A To allow duplicate tuples in the table by filling the primary key column(s) with NULL
B To avoid confusion with actual legitimate data values like 0 (zero) for integer columns and ’’ (the empty string) for string columns
C To leave columns in a tuple marked as ’’unknown’’ when the actual value is unknown
D To fill a column in a tuple when that column does not really ”exist” for that particular tuple

Answer: Option [B]
16 Suppose you are given a binary tree with n nodes, such that each node has exactly either zero or two children. The maximum height of the tree will be
A n 2 – 1
B n 2 + 1
C (n – 1)/2
D (n + 1)/2

Answer: Option [B]
17 Which of the following is not an inherent application of stack ?
A Implementation of recursion
B Evaluation of a postfix expression
C Job scheduling
D Reverse a string

Answer: Option [B]
18 In how many ways can the string A ∩ B – A ∩ B – A be fully parenthesized to yield an infix expression ?
A 15
B 14
C 13
D 12

Answer: Option [B]
19 A multiplexer combines four 100-Kbps channels using a time slot of 2 bits. What is the bit rate ?
A 100 Kbps
B 200 Kbps
C 400 Kbps
D 1000 Kbps

Answer: Option [B]
20 In a fully-connected mesh network with 10 computers, total ______ number of cables are required and ______ number of ports are required for each device.
A 40, 9
B 45, 10
C 45, 9
D 50, 10

Answer: Option [B]