Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

Algorithms | Bit Algorithms | Question 2

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

What does the following C expression do? x = (x<<1) + x + (x>>1);

(A)

Multiplies an integer with 7

(B)

Multiplies an integer with 3.5

(C)

Multiplies an integer with 3

(D)

Multiplies an integer with 8


Answer: (B)

Explanation:

The expression multiplies an integer with 3.5. For example, if x is 4, the expression returns 14. If x is 6, it returns 21. If x is 5, it return 17. See Multiply a given Integer with 3.5 for more details.


Quiz of this Question
Please comment below if you find anything wrong in the above post

My Personal Notes arrow_drop_up
Last Updated : 01 Jun, 2021
Like Article
Save Article
Similar Reads