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
How to declare a pointer to an array of integers?
What is meant by the term name mangling in c++?
What is a memory leak c++?
How do you declare A pointer to function which receives an int pointer and returns a float pointer
What is the difference between the functions rand(), random(), srand() and randomize()?
Is it possible to write a c++ template to check for a function's existence?
What is a static member?
What is the difference between an array and a list?
What is the use of setfill in c++?
What is the difference between global int and static int declaration?
Explain "const" reference arguments in function?
What are structs in c++?
What is the difference between an enumeration and a set of pre-processor # defines?
Why are pointers used?
How compile and run c++ program in turbo c++?