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

21

What will be the output of the program? #include

a.

5

b.

10

c.

Error

d.

Garbage value

Correct Answer & Explanation:

c

Here we are indirectly trying to change the value of the constant vaiable x. This will result in an error.

Q

22

How many times "IndiaBIX" is get printed? #include

a.

Infinite times

b.

11 times

c.

0 times

d.

10 times

Correct Answer & Explanation:

c

As soon as break statement executes it exits the block.

Q

23

What do the following declaration signify? int (*pf)();

a.

pf is a pointer to function.

b.

pf is a function pointer.

c.

pf is a pointer to a function which return int

d.

pf is a function of pointer variable.

Correct Answer & Explanation:

c

None

Q

24

Declare the following statement? "A pointer to a function which receives an int pointer and returns float pointer".

a.

float *(ptr)*int;

b.

float *(*ptr)(int)

c.

float *(*ptr)(int*)

d.

float (*ptr)(int)

Correct Answer & Explanation:

c

So it is simple return type should be float and input should be int.

Q

25

What do the 'c' and 'v' in argv stands for?

a.

c' means argument control 'v' means argument vector

b.

c' means argument count 'v' means argument vertex

c.

c' means argument count 'v' means argument vector

d.

c' means argument configuration 'v' means argument visibility

Correct Answer & Explanation:

c

c' means argument count 'v' means argument vector

Q

26

What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?

a.

The element will be set to 0.

b.

The compiler would report an error.

c.

The program may crash if some important data gets overwritten.

d.

The array size would appropriately grow.

Correct Answer & Explanation:

c

The program may crash if some important data gets overwritten.

Q

27

In which stage the following code #include

a.

During editing

b.

During linking

c.

During execution

d.

During preprocessing

Correct Answer & Explanation:

d

The preprocessor replaces the line #include <stdio.h> with the system header file of that name. More precisely, the entire text of the file 'stdio.h' replaces the #include directive.

Q

28

#include

a.

3, 2, 0515

b.

0515, 2, 3

c.

3, 2, 2005

d.

515, 515, 4

Correct Answer & Explanation:

a

The system will allocate 2 bytes for the union.The statements u.ch[0]=3; u.ch[1]=2; store data in memory as given below.

Q

29

What will you do to treat the constant 3.14 as a float?

a.

use float(3.14f)

b.

use 3.14f

c.

use f(3.14)

d.

use (f)(3.14)

Correct Answer & Explanation:

b

Given 3.14 is a double constant.To specify 3.14 as float, we have to add f to the 3.14. (i.e 3.14f)

Q

30

What will be the output of the program? #include

a.

0xffff

b.

Garbage value

c.

0xffee

d.

Error

Correct Answer & Explanation:

b

The output is unpredictable since buffer is an auto array and will die when the control go back to main. Thus s will be pointing to an array , which not exists.

bottom of page