Multiply a number by 2 and divide by 2 using left and right bit shift operators.
Difficulty: Easy
Phase: 6 · Mixed Logical Challenges
XP Reward: 10 XP
Topics: Mixed Logical Challenges, Easy
Supported Languages: Python, JavaScript, C, C++, Java
Problem Description
Given integer N, print N multiplied by 2 (using << 1) and N divided by 2 (using >> 1) separated by space. Input Format: Read input from standard input (stdin). Output Format: Print the result to standard output (stdout).
Constraints
- -10^9 <= N <= 10^9
Examples
Example 1
Input: 10
Output: 20 5
Explanation: Sample execution for input 10