answersLogoWhite

0


Best Answer

num1 <<= 1; /* shift left */

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Which is the code to multiply a number num1 by 2 using bitwise operator in c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you Swap two numbers using bitwise operator C?

//lets assume a = 10; b = 20; a = a^b; b = a^b; a = a^b;


What number could you multiply by 87?

You can multiply by using what other number that you use to multiply.


Can you multiply any number using 92?

Yes.


How do you find the greatest of three numbers using ternery operator?

Compare the first two numbers with the ternary operator. Store the result in a temporary variable. Compare the temporary variable with the third number, again using the ternary operator.


You are thinking of a number you multiply it by 13 and subtract 209 you get the same answer if you multiply by 5 and subtract 9 what is your number?

Using algebra the number works out as 25


How-to to add to values in java core without using plus operator?

Though Java, unlike other languages, does not allow you to directly access the core, memory addresses and system variables, it does have binary operators, such as the shifters &gt;&gt;, &lt;&lt;, and the bitwise operators, |, &amp;, ^. Using these operators, ALL calculations in the computer can be done, even your complicated trig functions. Though options are limited in Java, it does provide a simulated access to low level operations. The bitwise operators are in the link below. Look at the link below to see how the computer really does math.


What is the restriction to be followed when using a modulo operator modulo operator?

When using the modulo operator in mathematics or programming, there is a restriction that the divisor (the number after the modulo operator) should be non-zero. A zero divisor would result in a division by zero error, which is undefined.


How do you write find out the power of a number without using operator and predefined functions?

With repeated multiplication.


What is the use of complementry operator in c?

The bitwise complement or one's complement operator (~) is used to switch the state of all the bits in a value. Thus 1's become 0, and 0's become 1. One of its many uses is to unset individual bit(s) in a bitmap. We do this with a bitwise AND of the bitmap and the bitwise complement of the bit(s) we want to unset. Original bitmap: 01011100 Bit to unset: 00000100 (e.g., bit 2 (bits are zero based from right)) // Using one's complement and bitwise AND ~00000100 &amp; 01011100 11111011 (one's complement of bit 2) &amp; 01011100 (original bitmap) = 01011000 (original bitmap with bit 2 unset) Note that this formula works even if bit 2 were already unset: 11111011 (one's complement of bit 2) &amp; 01011000 (original bitmap, with bit 2 unset) = 01011000 (original bitmap unchanged)


How do you multiply a fraction by a whole number without using a model or repeated addition?

Multiply the whole number times the numerator. Divide the product by the denominator.


How do you multiply a 4 digit number by a 2 digit number?

Using a calculator will make it easier


Can you make a target number thirty Seven by using number five five times. You can use any math operator as you want?

No.