Is it better to bitshift a value than to multiply by 2?



Is it better to bitshift a value than to multiply by 2?..

Answer / Vartika Gupta

"Bitshifting is faster than multiplication by 2 in some processors, but in general-purpose programming languages like C, the difference is negligible."

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

Write a c program to read a positive number and display it in words.? ex: 123=one two three help me....

2 Answers  


Can u return two values using return keyword? If yes, how? If no, why?

7 Answers  


What are the two types of structure?

1 Answers  


Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?

1 Answers  


what is a far pointer

12 Answers   ABB, DRDO, ITI, Maruti Suzuki, Steel Plant, TCS, Toyota, Vivo Mobiles,


What is output redirection?

1 Answers  


what is the diference between pointer to the function and function to the pointer?

2 Answers   Infosys,


union { char ch[10]; short s; }test; test.s = 0xabcd; main() { printf("%d",ch[10]); }

3 Answers  


why in C,C++'s int size is 2 byte and .net(c#) int Size is 4 byte?

2 Answers  


11. Look at the Code: #include<string.h> void main() { char s1[]="abcd"; char s2[10]; char s3[]="efgh"; int i; clrscr(); i=strcmp(strcat(s3,ctrcpy(s2,s1))strcat(s3,"abcd")); printf("%d",i); } What will be the output? A)No output B) A Non Integer C)0 D) Garbage

7 Answers   Accenture,


What does double pointer mean in c?

1 Answers  


Explain the meaning of keyword 'extern' in a function declaration.

1 Answers  


Categories