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
Explain the difference between abstract class and interface in c++?
Explain what data encapsulation is in c++?
Do you know what are pure virtual functions?
Is swift a good first language?
Evaluate as true or false: !(1 &&0 || !1) a) True b) False c) Invalid statement
what is the difference between linear list linked representaion and linked representation? what is the purpose of representing the linear list in linked represention ? is it not avoiding rules of linear represention?
Write a program to find the Factorial of a number
What are the important differences between c++ and java?
Explain rtti.
Explain the register storage classes in c++.
When does the c++ compiler create temporary variables?
What do you know about near, far and huge pointer?
Does a derived class inherit or doesn't inherit?
What does scope resolution operator do?
How much maximum can you allocate in a single call to malloc()?