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 do the header files usually contains?
What is the array and initializing arrays in c++?
Are strings immutable in c++?
Why #include is used?
What is a set in c++?
Mention the ways in which parameterized can be invoked. Give an example of each.
Is c++ a low level language?
Which software is used to run c++ program?
What is data binding in c++?
How the programmer of a class should decide whether to declare member function or a friend function?
What is encapsulation in c++?
Show the declaration for a static member variable.
What is command line arguments in C++? What are its uses? Where we have to use this?
How can I learn dev c++ programming?
What is friend class in c++ with example?