Q. What will be the output of the following code snippet?

Code:
#include <stdio.h>
void solve() {
    int x = 2;
    printf("%d", (x << 1) + (x >> 1));
}
int main() {
    solve();
	return 0;
}
  • (A) 5
  • (B) 4
  • (C) 2
  • (D) 1
πŸ’¬ Discuss
βœ… Correct Answer: (A) 5

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
188
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Manisha Agrawal
Publisher
πŸ“ˆ
98%
Success Rate