Home »» Placement Papers »» All Papers »» HCL »» Placement Paper

HCL Placement Papers - HCL previously asked technical c language interview question and answers


C programming Questions:
1. int a = 3;
int b = 31;
int c = 10;
double z = b / c % a;
printf("%fn", z);

a. -1
b. 1
c. 0
d. 3

Answer – c

2. The subscript of the first element of an array is 0. 

True
False 

Answer – True

3. The machine registers are also called
Global variables
Local variables
constants
Static variables

Answer – b

4. What will be output of following code
main()
{
int i=1;
printf("%d%d%d",i,++i,i++);
}

a. 1 2 2
b. 2 2 1
c. 1 3 3
d. 3 3 1

Answer – d

5. When do we get segmentation fault error?

a. Accessing an array out of its bounds
b. Trying to modify a read-only location
c. Dereferencing an uninitialized pointer
d. All of the above

Answer – d

Data structure Questions:

1. Which of the following operations are dependent on the length of the linked list if there are pointers to first and last nodes of a single linked list?

a. Delete the first element
b. Insert a new element as a first element
c. Delete the last element of the list
d. Add a new element at the end of the list

Answer – c

2. Key value pair is seen in

a.Hash tables
b.Heaps
c.Both a and b
d.None above

Answer – a 


Comment

0 Answers