import java.util.Scanner; public class Multiply_Bitwise { public static void main(String[] args) { int n; Scanner s = new Scanner(System.in); System.out.print("Enter the number:"); n = s.nextInt(); int mul = n << 2; System.out.println("Answer:"+mul); } }
Enter the number:5 Answer:20
Enter the number you wish to multiply as input. After that we use left shift by 2 to multiply given input by four and hence get the output.