Question for Technical Aptitude

Question for Technical Aptitude 

1. On which side of the assignment statement , one can use a loop index?

a) Left

b) Right

c)Left or Right

d)Loop index can't be used in an assignment

Ans:- b) Right

2. What is the output of this program?

void main()

{

int arr[10];

print("%d %d", arr[-2], arr[11]);

}

a) 0 0

b) Garbage Value 0

c) Garbage Value Garbage Value

d) Compilation Error

Ans:-  c) Garbage Value Garbage Value

3. What is called where child object gets killed if parent objects killed?

a) Aggregation

b) Composition

c) Encapsulation

d) Association

Ans:- b) Composition

4. What is the name of the control structure used to stop any loop prematurely and only out of the loop, not affecting the running of the rest of the program?

a) The continue statement

b) The break statement

c) The exit statement

d) The purge statement

Ans:- b) The break statement

5. What is a linker program?

a) places the program in the memory for the purpose of execution.

b) relocates the program to execute from the specific memory area allocated to it.

c) links the program with other programs needed for its execution.

d) interfaces the program with the entities generating its input data.

Ans:- c) links the program with other programs needed for its execution.

6. Consider the implementation of the singly linked list having the head pointer only in the representation. Which of the following operations can be performed in O(1) time?

a)Deletion of the last node in the linked list

b)Insertion at the front of the linked list.

c)Deletion of the first node in the linked list

d)Insertion at the end of the linked list.

i) b

ii) b & c

iii) a & d

iv) both a & b 

Ans:- ii) b & c

Post a Comment

0 Comments