top of page
  • Facebook
  • Twitter
  • Instagram

Placement Preparation Questions

Placement Preparation questions are free resources offered by mobiprep that can help you ace any company placement process. We have curated a list of the most important MCQ questions which are asked in most companies such as Infosys, TCS, Wipro, Accenture, etc. The placement preparation questions also have detailed explanations for every question ensuring you revise all the questions with detailed answers and explanations.

Q

31

How many bytes of memory will the following code reserve? #include

a.

65536

b.

Allocation failed

c.

Error

d.

No output

Correct Answer & Explanation:

b

Hence 256*256 = 65536 is passed to malloc() function which can allocate upto 65535. So the memory allocation will be failed in 16 bit platform.

Q

32

What is the output of the following program? #include

a.

73 73

b.

60 13

c.

13 60

d.

60 60

Correct Answer & Explanation:

b

60 13, its swapping.

Q

33

For the below definition what is the data type of ‘PI’ #define PI 3.141

a.

Its float

b.

Its double

c.

There is no type associated with PI, as it’s just a text substitution

d.

Syntax error, semi colon is missing with the definition of PI

Correct Answer & Explanation:

c

The text associated with the macro name gets expanded at the line of call. The expanded text is by default a double constant whereas no type is associated with PI.

Q

34

The equivalent pointer expression by using the array element a[i][j][k][2]

a.

((((a+m)+n)+o)+p)

b.

*(*(*(*(a+i)+j)+k)+2)

c.

*( (((a+m)+n)+o+p)

d.

*( ((a+m)+n+o+p)

Correct Answer & Explanation:

b

If, the array element is a[i][j] = *(*(a+i)+j). If, the array element is a[i][j][k]= *(*(*(a+i)+j)+k)

Q

35

Far pointer can access _____

a.

Single memory location

b.

No memory location

c.

All memory location

d.

First and Last Memory Address

Correct Answer & Explanation:

c

All memory location

Q

36

A pointer pointing to a memory location of the variable even after deletion of the variable is known as _____

a.

far pointer

b.

dangling pointer

c.

null pointer

d.

void pointer

Correct Answer & Explanation:

b

dangling pointer

Q

37

What is the output of this statement "printf("%d", ++(a++))"?

a.

The value of (a + 1)

b.

The current value of a

c.

Error message

d.

Garbage

Correct Answer & Explanation:

c

increment after the () is the reason for error.

Q

38

In the C language, the constant is defined _______.

a.

Before main

b.

After main

c.

Anywhere, but starting on a new line.

d.

None of the these.

Correct Answer & Explanation:

c

In the C language, the constant is defined anywhere, but starting on a new line.

Q

39

Directives are translated by the

a.

Pre-processor

b.

Compiler

c.

Linker

d.

Editor

Correct Answer & Explanation:

a

In C language, the pre-processor is a macro processor that is dynamically used by the C programmer to modify the program before it is properly compiled

Q

40

Which one is the correct description for the variable balance declared below? int ** balance;

a.

Balance is a point to an integer

b.

Balance is a pointer to a pointer to an integer

c.

Balance is a pointer to a pointer to a pointer to an integer

d.

Balance is an array of integer

Correct Answer & Explanation:

b

This code description states that the remainder is a pointer to a pointer to an integer.

bottom of page