Write a program to multiply a number by 8 without using the * operator

Just left shift by 3 bits. By left shifting a number by 1 bit we are multiplying by 2.

Left Shift by 1 bit => Multiply by 2
Left Shift by 2 bit => Multiply by 4
Left Shift by 3 bit => Multiply by 8

The number 8 => 00001000

Left Shift by 1 bit => 00010000 ( 16 )
Left Shift by 2 bit => 00100000 ( 32 )
Left Shift by 3 bit => 01000000 ( 34 )

This is a practice question comment down the answer below