# HCL Placement: Sample Questions 26 - 27 of 57

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

## Question 26

### Question

MCQ▾

What is the output of the following program?

1. `main()`
2. `{`
3. `    int a=10;`
4. `    int b=6;`
5. `    if(a=3)`
6. `    b++;`
7. `    printf("%d %dn",a,b++);`
8. `}`

Choice (4)

a.

3,6

b.

3,7

c.

10,6

d.

10,7

b.

### Explanation

• In the main () function two integer variables are defined with a = 10 and b = 6.
• In the if statement we are not checking any condition but passing value 3 to variable a.
• b ++ is the post increment operator. After its execution value of b will be incremented by 1. So, now value of b will be
• In the printf statement we want to print the value of a and b ++ with format specifier % d.
• Value of a is now 3 and b ++ is post increment operator, where value of b is substituted first and then it is incremented by 1. So, 7 will be printed.
• Output of the program will be 3,7.

## Question 27

### Question

MCQ▾

What is the size of the following union? Assume that the size of int = 2, size of float = 4 and size of char = 1.

1. `Union Tag`
2. `{`
3. `    int a;`
4. `    flaot b;`
5. `    char c;`
6. `};`

Choice (4)

a.

2

b.

1

c.

7

d.

4