wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Technical Training Test for III BTech - VCE - CSE

Total questions: 45

Worksheet time: 53mins

Name
Class
Date
1.

What is the output of Java code snippet below?

short p = 1;

short k = p + 2;

System.out.println(k);

a)

1

b)

2

c)

3

d)

Compiler error

2.

What is the output of the Java code snippet?

int a=5, b=10, c=15;

a -= 3;

b *= 2;

c /= 5;

System.out.println(a +" " + b + " " + c);

a)

2 20 3

b)

2 20 5

c)

2 10 5

d)

-2 20 3

3.

Between Postfix and Prefix arithmetic operators in Java, which operators have more priority?

a)

Postfix operators have more priority than Prefix operators

b)

Prefix operators have more priority than Postfix operators

c)

Both Prefix and Postfix operators have equal priority

d)

None of the above

4.

Output of the following code snippet (JAVA)?

class Main {

public static void main(String args[]) {

int t;

System.out.println(t);

}


}

a)

0

b)

Garbage value

c)

Compiler error

d)

Runtime error

5.

Output of the code snippet

a)

Hello

b)

Empty Output

c)

Compile time error

d)

Runtime error

6.

What is the output (JAVA)?

a)

0

b)

1

c)

True

d)

False

7.

What is the error in this code(JAVA)?

byte b = 50;

b = b * 50;

a)

b can not contain value 100, limited by its range.

b)

* operator has converted b * 50 into int, which can not be converted to byte without casting.

c)

b can not contain value 50.

d)

No error in this code

8.

What will be the output of the following program(JAVA)?

a)

a and x 270 14

b and a 128.128 128

b and x 128.128 -128

b)

a and x 270 14

b and x 128.128 -128

b and a 128.128 128

c)

a and x 270.0 14.0

b and a 128.128 128

b and x 128.128 -128

d)

Compilation Error or Runtime Error

9.

What is Truncation is Java?

a)

Floating-point value assigned to an integer type.

b)

Integer value assigned to floating type.

c)

Floating-point value assigned to an Floating type.

d)

Integer value assigned to floating type.

10.

What will be the output of the following code snippet(JAVA)?

a)

Error

b)

15

c)

25

d)

NO output

11.

Which of the following for loop declaration is not valid(JAVA)?

a)

for ( int i = 99; i >= 0; i / 9 )

b)

for ( int i = 7; i <= 77; i += 7 )

c)

for ( int i = 20; i >= 2; - -i )

d)

for ( int i = 2; i <= 20; i = 2* i )

12.

Which statement is true (JAVA)?

a)

Compilation fails.

b)

"odd" will always be output.

c)

"even" will always be output.

d)

"odd" will be output for odd values of x, and "even" for even values

13.

Which of the following is true for variable names in C?

a)

Variable names cannot start with a digit

b)

Variable can be of any length

c)

They can contain alphanumeric characters as well as special characters

d)

Reserved Word can be used as variable name

14.

What is the output of this program(C) ?

a)

Compilations Error

b)

10

c)

1010

d)

10.1

15.

What is the output of this program(C)?

a)

Syntax error in declaration of a

b)

No errors, program will show the output 5

c)

Redeclaration of a in same scope throws error

d)

a is out of scope when printf is called

16.

The output of the following code snippet (C) ?

a)

p=1 q=1

b)

p=1 q=2

c)

p=2 q=2

d)

Invalid Syntex

17.

What is the output of this C code?

a)

Compilation error

b)

Undefined behavior

c)

Whatever user types

d)

Depends on the standard

18.

What is the output of this C code?

a)

hellonworld!

b)

hello world!

c)

hello

d)

hello world!

19.

How many times the following code prints the string “hello”


for(i=1;i<=50;i++)

printf(“Hello”);

a)

1

b)

50

c)

0

d)

None of the remaining option s

20.

What is the output of this C code?

a)

Compilation error

b)

Somegarbage value

c)

Whatever user types

d)

Depends on the standard

21.

What does the following code print(PYTHON)?

a)

This is always printed

b)

The negative number -10 is not valid here

This is always printed

c)

The negative number -10 is not valid here

d)

It will cause an error because every if statement must have an else statement.

22.

What will be the output of given Python code?

a)

2

b)

6 5 2

c)

3

d)

5 2

23.

What will be the output of the following Python code?

a)

8 9

b)

8 3

c)

2 3

d)

8 12

24.

When does the else statement written after the loop executes?

a)

When break statement is executed in the loop

b)

When loop condition becomes false

c)

Else statement is always executed

d)

None of the above

25.

What will be the output of the following code(PYTHON)?

a)

a b c d e f

b)

abcdef

c)

i i i i i.....

d)

No Output

26.

Suppose a tuple arr contains 10 elements. How can you set the 5th element of the tuple to 'Hello'(PYTHON)?

a)

arr[4] = 'Hello'

b)

arr(4) = 'Hello'

c)

arr[5] = 'Hello'

d)

Elements of tuple cannot be changed

27.

What is the output of the following PYTHON program :

print((1, 2) + (3, 4))

a)

(1, 2), (3, 4)

b)

(4, 6)

c)

(1, 2, 3, 4)

d)

Invalid Syntax

28.

Which of these about a dictionary is false?

a)

The values of a dictionary can be accessed using keys

b)

The keys of a dictionary can be accessed using values

c)

Dictionaries are ordered

d)

Dictionaries are mutable

29.

Which one of the following is False regarding data types in Python?

a)

In python, explicit data type conversion is possible

b)

Mutable data types are those that can be changed.

c)

Immutable data types are those that cannot be changed.

d)

None of the above

30.

Choose correct output for the following sequence of operations( STACK/DS).


push(5)

push(8)

pop

push(2)

push(5)

pop

pop

pop

push(1)

Pop

a)

8 5 2 5 1

b)

8 5 5 2 1

c)

8 2 5 5 1

d)

8 1 2 5 5

31.

Stack data structure cannot be used for

a)

Implementation of Recursive Function

b)

Allocation Resources and Scheduling

c)

Reversing string

d)

Evaluation of string in postfix form

32.

Entries in a stack are "ordered". What is the meaning of this statement?

a)

A collection of stacks can be sorted.

b)

Stack entries may be compared with the <' operation.

c)

The entries are stored in a linked list.

d)

There is a Sequential entry that is one by one.

33.

Which of the following applications may use a stack?

a)

A parentheses balancing program

b)

Tracking of local variables at run time

c)

Compiler Syntax Analyzer

d)

All of the above

34.

Pushing an element into stack already having five elements and stack has fixed size of 5, then _____ occurs.

a)

Overflow

b)

Crash

c)

Underflow

d)

User flow

35.

Convert the following infix expressions into its equivalent postfix expressions.

(A + B ⋀D)/(E – F)+G

a)

(A B D ⋀ + E F – / G +)

b)

(A B D +⋀ E F – / G +)

c)

(A B D ⋀ + E F/- G +)

d)

(A B D E F + ⋀ / – G +)

36.

The equivalent infix expression and value for the postfix form 1 2 + 3 * 4 5 * – will be ___________

a)

1 + 2 * 3 – 4 * 5 and -13

b)

(2 + 1) * (3 – 4) * 5 and 13

c)

1 + 2 * (3 – 4) * 5 and -11

d)

(1 + 2) * 3 – (4 * 5) and -11

37.

How many stacks are required for applying evaluation of infix expression algorithm?

a)

1

b)

2

c)

3

d)

4

38.

Which of the following statement is incorrect with respect to evaluation of infix expression algorithm?

a)

Operand is pushed on to the stack

b)

If the precedence of operator is higher, pop two operands and evaluate

c)

If the precedence of operator is lower, pop two operands and evaluate

d)

The result is pushed on to the operand stack

39.

Evaluate the following infix expression using algorithm and choose the correct answer. a+b*c-d/e^f where a=1, b=2, c=3, d=4, e=2, f=2.

a)

6

b)

8

c)

9

d)

7

40.

From the given expression tree, identify the infix expression, evaluate it and choose the correct result.

a)

5

b)

10

c)

12

d)

16

41.

What is the time complexity of reversing a word using stack algorithm?

a)

O (N log N)

b)

O (N2)

c)

O (N)

d)

O (M log N)

42.

What will be output if the following sequence of operations are executed?

Push(a,s);

Push(b,s);

Pop(b);

Push(c,s);

a)

abc

b)

b

c)

ac

d)

acb

43.

What are the set of functions that are to be executed to get the following output?

cat

a)

push(c, s); push(a, s); push(t, s);

pop(s); pop(s); pop(s);

b)

push(c,s); pop(s); push(a,s); pop(s);push(t,s);pop(s);

c)

pop(c ); pop(a); pop(t);

d)

push(c,s); push(a,s); pop(t)

44.

Consider the postfix expression 4 5 6 a b 7 8 a c, where a, b, c are operators. Operator a has higher precedence over operators b and c. Operators b and c are right associative. Then, equivalent infix expression i

a)

4 a 5 6 b 7 8 a c

b)

4 a 5 c 6 b 7 a 8

c)

4 b 5 a 6 c 7 a 8

d)

4 a 5 b 6 c 7 a 8

45.

What will be the output after performing these sequence of operations

push(20);

push(4);

top();

pop();

pop();

pop();

push(5);

top();

a)

20

b)

4

c)

stack underflow

d)

5