Give a fast way to multiply a number by 7
Answer Posted / rupesh
There is a problem with
x=(x<<3)-x;
Suppose that x is stored in 8 bit format.
If x = 64, i.e. 2^6, then this won't work.
In general, if x is n-bit, and value of x > 2^(n-3), then
this won't work.
Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;
There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?
Can we declare variables anywhere in c?
How can you pass an array to a function by value?
Can static variables be declared in a header file?
Is there any demerits of using pointer?
How can you return multiple values from a function?
Write a program to print all permutations of a given string.
Explain modulus operator.
Can a pointer be static?
Describe newline escape sequence with a sample program?
What is bubble sort in c?
What is a memory leak? How to avoid it?
What is the best way to comment out a section of code that contains comments?
Which one would you prefer - a macro or a function?