wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Techno Excellent

Total questions: 40

Worksheet time: 21mins

Name
Class
Date
1.

What will be the output of given python code

a)

0

1

2

4

5

6

b)

1

2

4

5

c)

0

1

4

5

d)

1

2

4

5

6

2.

Predict the output of following Python Program.

a)

Error

b)

GeeksforGeeks + 13

c)

GeeksforGeeks+13

d)

13 + GeeksforGeeks

3.

What will be the output of following python code

a)

1:1

3:3

b)

1:10

c)

2

d)

3

4.

Look at given python code. What will it give?

a)

[True, 50, 5, 10] Sum is: 66

b)

TypeError: unsupported operand type(s) for +: ‘int’ and ‘str’

c)

[True, 50, 10, 5] Sum is: 66

d)

[True, 50, 5, 10] Sum is: 65

5.

which is the correct option for following python code?

int1 = 0b0010

print(int1)

a)

0b0010

b)

NameError: name '0b0010' is not defined

c)

SyntaxError

d)

2

6.

What is the right way to split given string in Python?

text = 'Python is a fun programming language'

a)

print(text.split('Python is a fun programming language'))

b)

text.split("")

c)

split(text)

print('text')

d)

print(text.split(' '))

7.

learn the following python code. What will be the output?

a)

list1[0]: Physic

list1[0]:chemistry

list1[0]:['chemistry',1997]

list2[1:5]2,3,4,5

b)

list1[0]: physics

list1[0]: 1997

list1[-2]: ['chemistry', 1997, 2000]

list2[1:5]: [2, 3, 4, 5]

c)

list1[0]: Physic

list1[0]:chemistry

list1[0]:[chemistry,1997]

list2[1:5]:1,2,3,4,5

d)

list1[0]: Physic

list1[0]:chemistry

list1[0]:[chemistry,1997,2000]

list2[1:5]:[1,2,3,4,5]

8.

How will you open file for reading as a text file in python?

please select two correct answer.

a)

open('file.txt')

b)

open('file.txt','r')

c)

open('file.txt','w')

d)

open('file.txt','b')

9.

What is the output of following C program?

a)

1 1

2 2

b)

2 1

1 2

c)

2 2

1 1

d)

1 2

2 1

10.

Which of the following is invalid variable name in C language?

a)

Abc_123

b)

_123

c)

1abc_

d)

_abc_123

11.

What does the above program print?

a)

6 5 5

b)

6 6 5

c)

6 5 6

d)

5 6 6

12.

The output of following C code is-

a)

The power of C

b)

The power of C

Simply C

c)

Error as case labels and switch expressions are not integer constant

d)

Simply C

13.

The value of i printed in above C code is (a)   .

(Give exact answer only)

14.

A string constant is a one-dimensional array of characters terminated by ____.

a)

'#'

b)

'/0'

c)

'\0'

d)

'$'

15.

Following data types are available in C language.

(multiple options can be selected)

a)

double, int, float

b)

short, long

c)

signed, unsigned

d)

char, string

16.

Select correct output to be printed by above C code. The strcmp() function returns a positive value when the first string is lexicographically greater than the second string.

a)

-1 0

b)

1 0

c)

0 -1

d)

1 1

17.

K4 and Q3 are graphs with the following structures. Which one of the following statements is TRUE in relation to these graphs?

a)

K4 is planar while Q3 is not

b)

Both K4 and Q3 are planar

c)

Q3 is planar while K4 is not

d)

Neither K4 not Q3 is planar

18.

In any undirected graph, the sum of degrees of all the nodes

a)

  Must be even

b)

Is twice the number of edges

c)

Must be ODD

d)

Need not be EVEN

19.

A tree with n nodes has (a)   edges.

20.

Symmetric difference of sets A and B is____. (u is union and n is intersection.)

a)

(A-B) U (B-A)

b)

(A U B) - (A n B)

c)

(A-B) n (B-A)

d)

(A n B) - (A U B)

21.

If the size of the stack is 10 and we try to add the 11th element in the stack then the condition is known as___

a)

Underflow

b)

Garbage collection

c)

Overflow

d)

None of the above

22.

Which data structure is mainly used for implementing the recursive algorithm?

a)

Queue

b)

Stack

c)

Binary tree

d)

Linked list

23.

Consider the following stack implemented using stack.

#define SIZE 11  

struct STACK  

{  

   int arr[SIZE];  

   int top=-1;   

}  

What would be the maximum value of the top that does not cause the overflow of the stack?

a)

8

b)

9

c)

11

d)

10

24.

Which one of the following is the correct way to increment the rear end in a circular queue?

a)

rear =rear+1

b)

(rear % max) + 1

c)

(rear+1) % max

d)

None of the above

25.

JDK stands for ____.

a)

Java development kit

b)

Java deployment kit

c)

JavaScript deployment kit

d)

None of these

26.

which one of the following is a legal deceleration of a two- dimensional array of integers in java

a)

int[] a[] = new int[5][];

b)

int[5][5] a = new int[][];

c)

int a = new int[5,5];

d)

int[][] a = new int[][5];

27.

which interface needs to be implemented in order to make an object seralized in java

a)

clonnable

b)

remote

c)

seralizable

d)

none of the above

28.

superclass of all classes representing the output stream of characters is -------------

a)

OutputStream

b)

Reader

c)

InputStream

d)

Writer

29.

which of this class is used by character streams for reading data from buffer

a)

BufferReader

b)

InputStreamReader

c)

FileReader

d)

FileInputStream

30.

which one of these events will cause the thread to die?

a)

on calling the sleep() method.

b)

when the execution of the run() method ends

c)

when the execution of the start() method ends

d)

on calling the wait() method

31.

Java is a

a)

Procedure Oriented Language

b)

Structure Oriented Language

c)

Object_Oriented Language

d)

Machine Language

32.

A ___________ file is created after successful compilation of a Java program.

a)

Object file

b)

Array file

c)

Class file

d)

String file

33.

Java is

a)

Machine dependent language

b)

Machine independent language

34.

_________ operator returns the remainder after division

a)

+

b)

/

c)

%

d)

*

35.

Operator used to access the members of a class /package

a)

(.) Dot

b)

(,) Comma

36.
a)

{1=C, 2=JavaEE, 4=Python, 3=PHP}

b)

{1=C, 2=JavaSE, 3=Python, 4=PHP}

c)

{1=C, 2=JavaEE, 3=Python, 4=PHP}

d)

{1=C, 2=JavaSE,2=JavaEE, 3=Python, 4=PHP}

e)

NullPointerException

37.
a)

{null=null, a=null, b=JavaSE, c=PHP, d=Python}

b)

{a=null, b=JavaSE, c=PHP, d=Python}

c)

{b=JavaSE, c=PHP, d=Python}

d)

Compilation Fails

38.

Find Output.

a)

{"Computer", "Programming","Networks","null"}

b)

{"Computer", "Programming","Networks",null,"null"}

c)

Line 11 : Genetates NullPointer Exception

d)

Line12: Generates NullPointerException

39.

List all arguments that exist in this program segment:-

a)

double point, String student

b)

point, student

c)

name, mark

d)

name[i], mark[i]

40.

Fix the error by replacing with the correct java statement.

a)

void Status(String student, double point)

b)

void Status ( name[i], mark[i] )

c)

int Status(String student, double point)

d)

void Status ( String name[i], double mark[i] )