Answer Posted / maria
1) For checking modulo use
num1&(num2-1)
instead:
num1%num2
2) For multiplying or dividing by 2 use left and right shift
accordingly.
3) In loop use, if code allows it, decrement,like this:
for(int i = MAX_VALUE ; i > 0 ; i--)
instead:
for(int i = 0 ; i < MAX_VALUE; i++)
Is This Answer Correct ? | 7 Yes | 7 No |
Post New Answer View All Answers
What is an incomplete type in c++?
Difference between overloaded functions and overridden functions
How are pointers type-cast?
Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;
How do I get good at c++ programming?
Is java the same as c++?
what does the following statement mean? int (*a)[4]
Explain abstraction.
What is heap sort in c++?
What is the protected keyword used for?
What is vector string in c++?
Why iomanip is used in c++?
What is a pointer with example?
How do you traverse a btree in backward in-order?
What is the difference between delegation and implemented-in-terms-of?