# Languages-C & C Plus Plus [3i Infotech Placement]: Sample Questions 174 - 176 of 354

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

## Question 174

C & C Plus Plus
Edit

### Write in Short

1. `main ()`
2. `{`
3. `    printf ( “%x” -1≪4);`
4. `}`

### Explanation

• In a program They are asking to print ( “% x” -1 << 4) ;
• let՚s take this answer given written the 1 in 16 bits

0000 0000 0000 0001

• -1 can be written in 2՚s complement no system as

1111 1111 1111 1111

• “<<” this operator is called Binary Left Shift Operator, so we have to left shift four times the least significant 4 bits are filled with 0՚s

1111 1111 1111 0000

• Here (1111 = F, 1111 = F, 1111, F0000 = 0)
• So the Answer is FFF0

## Question 175

C & C Plus Plus
Edit

### Write in Short

What do the functions atoi () , itoa () and gevt () do?

### Explanation

• atoi ()
• A macro that converts integer to character.
• itoa ()
• It converts an integer to string
• gcvt ()
• It converts a floating-point number to string.

## Question 176

C & C Plus Plus
Edit

### Describe in Detail

Essay▾

What is the output of the following program?

1. `main ()`
2. `{`
3. `    int i =3;`
4. `    for(;i++=0;)`
5. `    printf(“%d”, i);`
6. `}`

### Explanation

Compiler Error: Lvalue required.

In the program

 int i = 3; Given the integer variable i = 3 for (; i ++ = 0;) Increment operators return rvalues and hence it can՚t appear on the left hand side of an assignment operation.

Developed by: