Pre Board 1 (2021-22)
Class: XII
COMPUTER SCIENCE
PAPER 1
(THEORY)
Maximum Marks: 70
(One and a half Hours)
(Candidates are allowed additional 15 minutes for only reading the paper.)
ALL QUESTIONS ARE COMPULSORY
The marks intended for questions are given in brackets [ ].
Select the correct option for each of the following questions.
1. The law that represents X+X=X is: [1]
(a) Commutative Law
(b) Associative Law
(c) Idempotence Law
(d) Involution Law
Answer : _______________
2. The POS expression of X from the truth table given below is : [1]
A B X
0 0 1
0 1 0
1 0 0
1 1 0
(a) (A’+B’)
(b) (A+B)
(c) (A’+B) (A+B’) (A+B)
(d) (A’+B) (A+B’) (A’+B’)
Answer : _______________
3. The complement of F = 𝐴 ⊕ 𝐵is: [1]
(a) 𝐴̅𝐵 + 𝐴𝐵
(b) 𝐴̅𝐵 + 𝐴𝐵
(c) 𝐴̅𝐵 + 𝐴̅𝐵
(d) 𝐴𝐵 + 𝐴𝐵
Answer : _______________
4. The dual of (A+0) (A.1. 𝐴̅ ) is: [1]
(a) (𝐴. 0) + (𝐴. 1. 𝐴̅)
(b) (𝐴̅. 1) + (𝐴̅. 0. 𝐴)
1
Turnover
(c) (𝐴̅. 0) + (𝐴̅. 1. 𝐴)
(d) (𝐴. 1) + (𝐴. 0. 𝐴̅)
Answer : _______________
5. The expression which is equivalent to 𝑋 + 𝑋𝑌 is: [1]
(a) 𝑌
(b) 𝑋 + 𝑌
(c) 𝑋
(d) 𝑋 + 𝑌
Answer : _______________
6. Which of the following can replace a OR gate in a circuit? [1]
(a) NOT
(b) NAND
(c) XOR
(d) XNOR
Answer : _______________
7. In the following combinational circuit, if A =1 and B=0, which of the following will give [1]
an output 1?
(a) Y0
(b) Y1
(c) Y2
(d) Y3
Answer : _______________
8. A full adder is implemented using: [1]
(a) 3 AND, 1 XOR and 1 OR
(b) 3 OR, 1 XOR and 1 AND
(c) 3 AND, 1 XNOR and 1 OR
(d) 3 OR, 1 XNOR and 1 AND
Answer : _______________
9. A 4 variable K Map has : [1]
(a) 4 cells
(b) 8 cells
2
Turnover
(c) 16 cells
(d) 32 cells
Answer : _______________
10. The ˄ operator is known as: [1]
(a) Conjunction
(b) Disjunction
(c) Equivalence
(d) Implication
Answer : _______________
11. A matrix T[5][10] is stored in the memory in Column Major Wise with each element requiring 8
bytes of storage. If the base address at T[1][1] is 6300, then the address of T[4][6] will be:
[2]
(a) 6572
(b) 6580
(c) 6668
(d) 6524
Answer : _______________
12. The proposition (𝑝 → 𝑞) ⋀(𝑞 → 𝑝) is a [2]
(a) Contingency
(b) Tautology
(c) Contradiction
(d) Converse
Answer : _______________
13. What will be the output of the given statement? [2]
[Link]([Link]([Link](“45”), ‘E’));
(a) 45
(b) E
(c) 69
(d) ERROR
Answer : _______________
14. If d = The demand is low and i = There is a positive inflation, then the proposition to represent,
“If the demand is high, then there is a positive inflation” is, [2]
(a) 𝑖 → 𝑑̅
(b) 𝑖 → 𝑑
(c) 𝑑̅ → 𝑖
(d) 𝑑 → 𝑖
Answer : _______________
15. What will be the output of the given statement? [2]
[Link]('C'+7+"8"+'a');
(a) 147
3
Turnover
(b) C78a
(c) 6778a
(d) 748a
Answer : _______________
16. What is the conditional statement to check for the even boundary elements in a double dimensional
array of ‘M’ number of rows and ‘N’ number of columns? The row index is represented by ‘r’ and
the column index is represented by ‘c’. [2]
(a) (r= =0 || c= =0 || r = = n-1|| c= = n-1) && (r%2= =0||c%2= =0)
(b) (r= =0 && c= =0 && r = = n-1 && c= = n-1)&&(r%2= =0 && c%2= =0)
(c) (r= =1 || c= =1 || r = = n-1|| c= = n-1)&&(r%2= =0||c%2= =0)
(d) (r= =0 || c= =0 || r = = n|| c= = n)&&(r%2= =0||c%2= =0)
Answer : _______________
17. What will be the output of the following code? [2]
int i=1;
do
{ int j=1;
do
{
if(j%2==0)
[Link](“&”);
else
[Link](“=”);
j++;
}while(j<=i);
[Link]();
i++; }while(i<=4); }
(a) (b) (c) (d)
Answer : _______________
18. The reduced boolean expression for F(M,N,P)=П(1,3,6,7) is: [2]
(a) (𝑀𝑃 ) + (𝑀𝑁 )
(b) (𝑀𝑃) + (𝑀𝑁)
4
Turnover
(c) (𝑀 + 𝑃)(𝑀 + 𝑁)
(d) (𝑀 + 𝑃 )(𝑀 + 𝑁)
Answer : _______________
19. The proposition k = 𝑎 → (𝑏 + 𝑎) is a : [2]
(a) Tautology
(b) Fallacy
(c) Contingency
(d) Consistent statement
Answer : _______________
20. The Sum (S) bit and Carry(C) bit of a full adder when X=1, Y=1and Z=0 is: [2]
(a) S=0 C=0
(b) S=0 C=1
(c) S=1 C=0
(d) S=1 C=1
Answer : _______________
21. Reduce the given Boolean function : F(A,B,C,D) = Σ(0,1,3,4,5,7,12,13,15) by using 4-variable
Karnaugh map and answer the following questions.
(a) What will be the least number of groups and their types formed for reduction? [1]
(i) 6 Pairs
(ii) 4 Quads
(iii) 2 Quads and 2 Pairs
(iv) 3 Quads and 1 Pair
Answer : _______________
(b) The reduced expression of the given Boolean function is [2]
(i) 𝐴̅𝐶̅ + 𝐴̅𝐷 + 𝐵𝐶̅ + 𝐵𝐷
(ii) 𝐴𝐶 + 𝐴𝐷 + 𝐵 𝐶 + 𝐵𝐷
(iii) 𝐴̅𝐶̅ + 𝐴̅𝐷 + 𝐵 𝐶̅ + 𝐵𝐷
(iv) 𝐴𝐶̅ + 𝐴𝐷 + 𝐵𝐶̅ + 𝐵𝐷
Answer : _______________
22. Answer the following questions based on the logic circuit diagram,
5
Turnover
1
3
4
(a) The expression at (2) is [1]
(i) 𝑋⊕𝑌
(ii) 𝑋⊕𝑍
(iii) 𝑌⊕𝑍
(iv) 𝑋 ⊕ 𝑌
Answer : _______________
(b) The expression at (4) is [1]
(i) (𝑌 ⊕ 𝑍) + 𝑋
(ii) (𝑋 ⊕ 𝑍) . 𝑋
(iii) (𝑋 ⊕ 𝑍̅) + 𝑋
(iv) (𝑋 ⊕ 𝑌) + 𝑋
Answer : _______________
(c) The final expression F(X,Y,Z) is [1]
(i) (𝑋 + 𝑌) ⊕ 𝑌⨁ 𝑍 + 𝑋
(ii) 𝑋 + (𝑌 ⊕ 𝑌⨁ 𝑍 + 𝑋)
(iii) 𝑋. (𝑌 ⊕ 𝑌⨁𝑍). 𝑋
(iv) 𝑋 + 𝑌 ⊕ ((𝑌 ⨁ 𝑍) + 𝑋)
Answer : _______________
6
Turnover
23. A job consultant searches jobs for applicants. The criteria for selecting the job are,
The Salary is less than 50 K but the firm takes care of the wellness of the employee and provides
LTA or HRA
OR
HRA is provided as well as the firm takes care of the wellness of the employees.
OR
Salary is more than 50K, HRA and LTA is provided by the firm.
Inputs are S= Salary is more than 50K R = HRA is provided
W= Wellness of employees is taken care of. L= LTA is provided
Output F = Found
In all the cases, 1 indicates yes 0 indicates no.
Draw the truth table for the inputs and outputs given above and answer the following questions:
(a) The POS expression for F(S,R,W,L) will be: [2]
(i) Σ(0,1,2,4,5,8,9,10,11,12)
(ii) П(0,1,2,4,5,8,9,10,11,12)
(iii) Σ(3,6,7,13,14,15)
(iv) П(3,6,7,13,14,15)
Answer : _______________
(b) Which of the following is not considered while making groups in Kmaps? [1]
(i) Vertical
(ii) Horizontal
(iii) Diagonal
(iv) Rolling
Answer : _______________
24. Given the boolean equation F(A,B,C) = Σ(3,5,6,7), answer the following questions:
(a) What is the POS form of F? [1]
(i) П(0,1,2,4)
(ii) П(1,2,4,8)
(iii) П(0,1,4)
(iv) П(0,2,4)
Answer : _______________
(b) The canonical expression of the given Boolean function is [2]
(i) 𝐴𝐵𝐶 + 𝐴𝐵 + 𝐴𝐵𝐶̅ + 𝐴𝐶
(ii) 𝐴̅𝐵𝐶 + 𝐴𝐵 𝐶 + 𝐴̅𝐵𝐶̅ + 𝐴̅𝐵 𝐶
(iii) 𝐴̅𝐵𝐶 + 𝐴𝐵 𝐶̅ + 𝐴𝐵𝐶̅ + 𝐴𝐵 𝐶
(iv) 𝐴̅𝐵𝐶 + 𝐴𝐵 𝐶 + 𝐴𝐵𝐶̅ + 𝐴𝐵𝐶
Answer : _______________
25. Reduce the given Boolean function F(W,X,Y,Z) = П(4,5,7,13,14,15) by using 4-variable
Karnaugh map and answer the following questions.
7
Turnover
(a) What will be the least number of groups and their types formed for reduction? [1]
(i) 2 Quads and 2 Pairs
(ii) 1 Quad and 2 Pairs
(iii) 1 Quad and 3 Pairs
(iv) 2 Quads
Answer : _______________
(b) The reduced expression of the given Boolean function is [2]
(i) (𝑊 + 𝑌)(𝑋 + 𝑍̅ )(𝑊 + 𝑋 + 𝑌 )
(ii) (𝑊 + 𝑋 + 𝑌)(𝑋 + 𝑍̅)(𝑊 + 𝑌 )
(iii) (𝑊 + 𝑋 + 𝑌)(𝑋 + 𝑍)(𝑊 + 𝑋 + 𝑌)
(iv) (𝑊 + 𝑋 + 𝑌)(𝑋 + 𝑍̅)(𝑊 + 𝑋 + 𝑌)
Answer : _______________
26. With reference to the code given, answer the questions that follow:
int P_26(int Onum) {
int g=0;
for(int k = 1; k <= Onum; k++)
{
int c=0;
for (int i = 2; i <= k/2; i++)
if(k % i == 0)
{
c++;
break;
}
if(c == 0 && k != 1 )
g = g + k; }
return g; }
(a) What will the method P_26() return when the value of Onum=30? [2]
(i) 129
(ii) 119
(iii) 23
(iv) 0
Answer : _______________
(b) What is the method P_26( ) performing? [1]
(i) Sum of digits
(ii) Sum of Prime digits
(iii) Sum of Prime numbers
(iv) Sum of digits of Prime numbers
Answer : _______________
27. With reference to the code given, answer the questions that follow:
int P_27(int n1, int n2)
8
Turnover
{
while (n2 != 0) {
int remainder = n1 % n2;
n1 = n2;
n2 = remainder;}
return n1;
}
(a) What will the method P_27() return when the value of n1=36 and n2=54? [2]
(i) 2
(ii) 18
(iii) 36
(iv) 54
Answer : _______________
(b) What is the method P_27( ) performing? [1]
(i) Prime factors of n1 and n2
(ii) LCM of n1 and n2
(iii) HCF of n1 and n2
(iv) None of the above
Answer : _______________
28. With reference to the code given, answer the questions that follow:
int P_28(){
int i = 0, j, t = 0;
int[] arr = {10, 15, 4, 10, 8, 12, 10, 15, 55, 10, 60};
while(i <[Link])
{ j = i + 1;
while(j < [Link])
{
if(arr[i] = = arr[j]) {
t++;
break; }
j++; }
i++; }
return t; }
(a) What will the method P_28() return? [2]
(i) 10
(ii) 8
(iii) 12
(iv) 4
Answer : _______________
(b) What is the method P_28( ) performing? [1]
(i) Finding the duplicate data
9
Turnover
(ii) Finding the count of non-duplicate data
(iii) Finding the count of duplicate data
(iv) None of the above
Answer : _______________
29. With reference to the code given, answer the questions that follow:
void P_29(char arr1[ ], char arr2[ ]){
char[] B= new char[[Link]+[Link]];
for(int i=0, a=0,b=0; i<[Link]; i++)
{ if(i<[Link]-1)
{ B[i]=arr1[a];
a++; }
else
{ B[i]=arr2[b];
b++;
} }
for(int i=0;i<[Link];i++)
[Link](B[i]+" "); }
(a) What will the method P_29 print if arr1={‘A’,’P’,’R’,’I’,’L’} and arr2={’C’,’O’,’T’}?[2]
(i) Garbage Value
(ii) 65 80 82 73 67 79 84
(iii) A P R I C O T
(iv) A P R I L C O T
Answer : _______________
(b) What is the method P_29( ) doing? [1]
(i) Finding the Unicode values of the elements in two arrays
(ii) Conditional Merging of two arrays
(iii) Finding the largest element in two arrays
(iv) No Common function is performed
Answer : _______________
30. With reference to the code given, answer the questions that follow:
10
Turnover
void P_30( int A[][], int B[][]) {
int C[][] = new int[[Link]][B[1].length];
for (i = 0; i < [Link]; i++) {
for (j = 0; j < B[1].length; j++) {
for (k = 0; k < [Link]; k++)
C[i][j] += A[i][k] * B[k][j];
}}
for(int i=0;i<[Link];i++)
for(int j=0;j<C[1].length;j++)
[Link](C[i][j]); }
(a) What will P_30( ) print if A={ {1,2}, {3,4}} and B ={{5,6,7},{8,9,10}}? [2]
(i) 21 24 27 47 54 61
(ii) 3 7 18 26
(iii) 1 2 3 4
(iv) None
Answer : _______________
(b) What is the method P_30( ) doing? [1]
(i) Adding two matrices
(ii) Subtracting two matrices
(iii) Multiplying two matrices
(iv) Complementing two matrices
Answer : _______________
31. The following program code finds an element in an array using Binary Search. The array is sorted
in descending order. There are some places in the code marked as ?1?, ?2?, ?3?, ?4? and ?5? which
are to be replaced by a statement/expression so that the code works properly.
int binarySearch(int arr[],int N, int X)
{
int start = 0, end = N;
while (?1?) {
int mid = start + (end - start) / 2;
if (X == arr[mid]) {
return ?2?;
}
else if (X < arr[mid]) {
start = ?3? }
else {
end = ?4? }
}
return ?5?;
}
11
Turnover
Answer the following questions:
(a) What is the statement or expression at ?1? [1]
(i) start < end
(ii) start<=end
(iii) start >end
(iv) start >=end
Answer : _______________
(b) What is the statement or expression at ?2? [1]
(i) arr[mid]
(i) start
(ii) end
(iii) mid
Answer : _______________
(c) What is the statement or expression at ?3? [1]
(i) mid -1
(ii) mid
(iii) mid+1
(iv) (start+end)/2
Answer : _______________
(d) What is the statement or expression at ?4? [1]
(i) mid -1
(ii) mid
(iii) mid+1
(iv) (start+end)/2
Answer : _______________
(e) What is the statement or expression at ?5? [1]
(i) mid
(ii) 0
(iii) 1
(iv) -1
Answer : _______________
32. The following program finds the Primorial of a given number. A Primorial is the product of all the
prime numbers which are present from number till 1. There are some places in the code marked as
12
Turnover
?1?, ?2?, ?3?, ?4? and ?5? which are to be replaced by a statement/expression so that the code
works properly.
Example- Primorial of 10 is =7*5*3*2=210.
?1? primorial(int num){
long fact=1;
for(int i=num;?2?;i--)
{
int c=0;
for(int j=1; j<=i;j++)
if(?3?)
c++ ;
if(c= =2)
fact=?4?;
}
return ?5?; }
Answer the following questions:
(a) What is the statement or expression at ?1? [1]
(i) short
(ii) int
(iii) long
(iv) float
Answer : _______________
(b) What is the statement or expression at ?2? [1]
(i) i >=1
(ii) i>1
(iii) i<=1
(iv) i<1
Answer : _______________
(c) What is the statement or expression at ?3? [1]
(i) j%i = =0
(ii) j%2 = =0
(iii) i%j = = 0
(iv) i%2 = = 0
Answer : _______________
13
Turnover
(d) What is the statement or expression at ?4? [1]
(i) fact *i
(ii) fact *j
(iii) fact * c
(iv) fact * num
Answer : _______________
(e) What is the statement or expression at ?5? [1]
(i) 0
(ii) fact
(iii) c
(iv) num
Answer : _______________
------- End of Paper ------
14
Turnover