# Languages [HCL Placement]: Sample Questions 5 - 6 of 13

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

## Question 5

### Question

MCQ▾

What are the values printed by the following program?

1. `#define dprint(expr) printf(#expr "=%dn",expr)`
2. `main()`
3. `{`
4. `    int x=7;`
5. `    int y=3;`
6. `    dprintf(x/y);`
7. `}`

Choice (4)

a.

= 2

b.

#2 = 2

c.

expr = 2

d.

All of the above

a.

### Explanation

• In the main () function two integers are initialized, i.e.. x = 7, y = 3
• In the dprintf function we are passing x/y as expr.
• In that function we want to print the value of expr.
• Here, as x = 7 and y = 3 and both are integer variables their division will also result in an integer.
• Here, % d is the format specifier of integer.
• results into 2.333333 … but as variables and result is integer it will be 2 only.
• So, output will be .

## Question 6

### Question

MCQ▾

Which of the following about the following two declarations is true?

i) int ⚹ F ()

ii) int (⚹ F) ()

### Choices

Choice (4)

a.

The first declaration is a function returning a pointer to an integer and the second is a pointer to function returning int

b.

i & ii are identical

c.

i & ii are different ways of declaring pointer to a function

d.

The first is a correct declaration and the second is wrong