You are on page 1of 10

QUESTIONS PAPER –GCET,2005

COMPUTER SCIENCE
1. Which of the following protocols does the World Wide Web use for transmission of
web pages ?
(A) TCP/IP (B) FTP (C) HTML (D) HTTP

2. The following language is not used by web browsers


(A) Visual Basic (B) HTML (C) Javascript (D) XML

3. What is the most dominant LAN technology ?


(A) Modems (B) Token Ring
(C) Ethernet (D) FDDI

4. Which of the following is not a valid IP address ?


(A) 10.5.0.12 (B) 3.0.0.3
(C) 128.7.255.1 (D) 271.3.5.8

5. On which of the following links between two nodes A and B will a very small data
packet (few bits) take the longest time to reach the other end ?
(A)Twisted Pair Copper (B) Fibre
(C) Satellite (D) Microwave

6. Which of the following network topologies among the list below is incorrect ?
(A) Star (B) Internet (C) Ring (D) Bus

7. An OR gate can be implemented using which of the following combinations ?


(A) 1 AND gate and 1 NOT gate (B) 3 AND gates and 1 NOT gate
(C) 1 AND gate and 3 NOT gates (D) 2 AND gates and 2 NOT gates
8. The XOR function can be expressed in terms of AND (·), OR (+) and NOT ( ¯ ) as
(A) (A · B) + (A · B) (B) (A · B) + (A · B)
(C) (A + B) · (A + B) (D) (A · A) + (B · B)

9. Which of the following is not represented using a logic gate ?


(A) NAND (B) XOR (C) IF (D) NOT

10. Boolean algebra typically represents logical possibilities in a:


(A) Truth Table (B) Logarithm Table
(C) Logic Grid (D) Boolean Baseline

11. De Morgan’s Theorem shows that gate types can be used to represent alternative gate
types by :
(A) Reducing numbers to Binary (B) Inverting inputs and outputs
(C) Blocking inputs and outputs (D) Repeating inputs and outputs

12. A column that uniquely identifies each row in a database table is called :
(A) Foreign Key (B) Secondary Key
(C) Primary Key (D) Table ID

13. Consider the SQL command: Select * in PRODUCT; The * refers to:
(A) Every row of PRODUCT
(B) Every column in PRODUCT
(C) EVERY row and every column in PRODUCT
(D) All fields that begin with “A” to “Z”

14. The Primary Key is a field in a database table that:


(A) occurs maximum times (B) is unique
(C) can be duplicated (D) has they largest value
15. A field in a database represents
(A) One character of data
(B) An attribute of an entity
(C) An entity
(D) A set of entities

16. A queue Q of integers initially has four elements- 7, 9, 10, 11 (7 is first and 11 is last).
If we perform the following sequence of operations to the queue add 9, remove, add 7,
remove, add 10 what will be the third element of the resulting queue ?
(A) 9 (B) 10 (C) 7 (D) 11

17. Evaluating the postfix expression 5 - 3 2 - ++ gives the value


(A) -11 (B) 7 (C) 1 (D) -4

18. An array A contains 100 integers in sorted order. The best upper bound on the
number of comparisons needed to check whether a given integer n is in the array A is
(A) 4 (B) 8 (C) 16 (D) 100

19. A complete binary tree has i internal nodes and l leaves. Which of the following is
true ?
(A) i = l + 1 (B) i = l - 1
(C) l = 2i (D) l = 2 _ i

20. An list L contains 100 integers. To check if a given integer n is in the list, which of
the following is the best upper bound on the number of comparisons needed ?
(A) 99 (B) 4 (C) 7 (D) 100

21. A stack S is initally empty. After performing the following sequence of operations
push(3), push(4), pop, push(4), push(5), pop what is the top element of the stack ?
(A) 3 (B) 4 (C) 5 (D) 0
22. Using bubble sort to sort an array of 10 integers will need how many comparisons in
the worst case ?
(A) 45 (B) 100 (C) 90 (D) 36

23. A and B are two lists sorted (in ascending order) containing 10 integers each. What is
the minimum number of comparisons needed in the best case to produce a single sorted
list C containing all the 20 numbers ?
(A) 20 (B) 19 (C) 10 (D) 100

24. The last in first out (LIFO) mechanism is achieved by which data structure ?
(A) Queue (B) List
(C) Circular Queue (D) Stack

25. 100 numbers are read one by one from a file and inserted into a list (intially empty) to
produce a sorted (ascending order- smallest first) list. What is the maximum number of
comparisons that will be needed in worst case ?
(A) 99 (B) 10000 (C) 4950 (D) 1000

26. The infix form of the post-fix expression u v + w * x + is


(A) u + (v * w) + x (B) (u + v) * w + x
(C) (u + v) * (w + x) (D) u + (v * (w + x)

27. An integer array of size 10 is initialized as follows.


for (int j=0; j < 10; j++) {a[j] = j % 5;} Which is the sum of the elements of the array
after this ?
(A) 0 (B) 10 (C) 55 (D) 20

28. Assume that integer variables x, y, z have the values -3, 7, 15 respectively. What will
the following code segment print ?
if ((x <= y) && (x > z)) {cout << y;}
else {if ((x + y < 5) || (y < z)){cout << z;}
else {cout << (x + y + z);}};
(A) 7 (B) 15 (C) 19 (D) 12

29. After running code fragment


int ctr = 4; int ans = 23;
while (ctr < ans) {ans = ans + 2; ctr = ctr + 4;}
the value of variable ctr is
(A) 24 (B) 43 (C) 44 (D) 52
CS-A 5

30. Using the definition


void proc1(float & x, float y)
{x = x + 1; y = y + x;}
what does the following code segment print
float a = 2.3; float b = 3.2; proc1(a,b);
cout << a << " " << b << "\n" ;
(A) 2.3 3.2 (B) 2.3 5.5 (C) 3.3 6.5 (D) 3.3 3.2

31. What is the value of ans after running the following code ?
int ans = 1;
for (int n = 2; n != -2; n--){ans = ans * n;}
(A) 2 (B) 4 (C) -4 (D) 0

32. What is the value of ans after running the following code?
int ans = 0;
for (int n = 1; n < 8; n++){
switch(n % 3) {
case 0: {ans = ans + n; break;}
case 1: {break;}
case 2: {ans = ans + n; break;}}}
(A) 28 (B) 16 (C) 11 (D) 21
33. What is the value of ans after running the following code ?
int ans = 0; int n = 1;
do {ans = ans + 1; n++;} while(n < 10);
(A) 9 (B) 10 (C) 11 (D) 8

34. The postfix form of the infix expression (3 - 2) + (4 + 5) is:


(A) 3 - 2 + 4 + 5 (B) 2 - 3 + 5 + 4
(C) 3 2 - 4 5 + + (D) + - + 3 2 4 5

35. What is the value of the expression (11 & 30) ?


(A) 8 (B) 10 (C) 19 (D) 37

36. Evaluating the statement y = log(x) give y the value 0. What is the value of x ?
(A) 2 (B) 1.0 (C) e (D) 1.414
CS-A 6

37. An integer array of size 10 is initialized as follows.


for (int j=0; j < 10; j++){a[j] = j % 4;}
What is the sum of the elements of the array after this ?
(A) 0 (B) 10 (C) 55 (D) 13

38. Suppose a 2-dimensional (4x4) array A is initialized as follows.


for (int x = 0; x < 4; x++){
for (int y = x; y < 4; y++){
A[x,y] = x; A[y,x] = y;}}
How many elements of A have the value 2 ?
(A) 1 (B) 4 (C) 8 (D) 2

39. Suppose A is an array containing 100 integers. Finding the second largest integer in A
can be done within how many comparisons ?
(A) 101 (B) 99 (C) 150 (D) 197
40. Assume that variables x, y, z of type real have the values 2.3, 3.4,-0.4 respectively.
What is the value of ceil((y + z)/x) ?
(A) 2 (B) 3 (C) 0 (D) 4
41. The first in first out (FIFO) mechanism is achieved by which data structure ?
(A) Queue (B) List
(C) Circular Queue (D) Stack

42. 100 numbers are read one by one from a file and inserted into a list (intially empty) to
produce a sorted (ascending order- smallest first) list. What is the minimum number of
comparisons that will be needed in the best case ?
(A) 99 (B) 10000 (C) 4950 (D) 1000

43. What will be the output of the following code ?


float a = 2.3, b = 3.4;
{float b = 11.2, c = -0.4;
cout << floor((b + c) / a) << "\n";}
(A) Error (B) 5 (C) 4 (D) 0

44. What will be the output of the following code ?


cout << strlen("siva") << (char) toupper(’a’) << "\n";
(A) Error (B) 3A (C) 4A (D) 465

45. Suppose a and b are boolean variables. Which of the following expressions is
equivalent to
the expression !(a && b) ?
(A) !(a) && !(b) (B) !(a && !(b))
(C) !(a) || !(b) (D) !(a || b)

46. Suppose a and b are integer variables. Which of the following expressions always has
value true ?
(A) (a == b) || (b == a) (B) (a < b) || (b > a)
(C) (a < b) || (a > b) (D) (a == b) || !(b == a)
47. The three basic devices needed to set up a LAN can be best described as:
(A) NIC(Ethernet), Hub, Twisted pair/Coaxial cable
(B) Disk drive, CPU, Hub
(C) Hub, CPU, NIC(Ethernet)
(D) Disk drive , Hub, NIC(Ethernet)

48. The function of a modem is to convert signals. Identify the correct signals it converts.
(A) Analogue to Baud rate
(B) Baud rate to Analogue
(C) Digital to Binary
(D) Analogue to Digital

49. In C++ language, iostream.h is called


(A) A compiler file (B) An auxilliary file
(C) An extension file (D) A header file

50. You must use a semicolon in C++ after


(A) Every comment (B) Every statement
(C) Every curly brace (D) Return statement
ANSWER KEY
Q. No. ANS. (COMP.SC)
1 D
2 A
3 C
4 D
5 C
6 B
7 C
8 B
9 C
10 A
11 B
12 C
13 C
14 B
15 B
16 A
17 D
18 B
19 B
20 D
21 B
22 A
23 C
24 D
25 C
26 B
27 D
28 B
29 C
30 D
31 D
32 B
33 A
34 C
35 B
36 B
37 D
38 B
39 D
40 A
41 A
42 A
43 C
44 C
45 C
46 D
47 A
48 D
49 D
50 B