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
Which of the following is evaluated first: a) && b) || c) !
Describe linkages and types of linkages?
What is private public protected in c++?
Is vector a class in c++?
What is pointer in c++ with example?
Describe new operator and delete operator?
Can you overload the operator+ for short integers?
What is an iterator?
What do you mean by friend class & friend function in c++?
Can you help me with this one? Make a program that when a user inputed a Product Name, it will display its price, and when the user inputed the quantity of the inputed product, it will show its total price. The output must be like this: Product Name: Price: Quantity: Total Price: ..this is the list of products to be inputed: Cellphone - 1500 Washing Machine - 5200 Television - 6000 Refrigirator - 8000 Oven - 2000 Computer - 11000 thanks..:D
What is a hash function c++?
How do you generate a random number in c++?
Snake Game: This is normal snake game which you can find in most of the mobiles. You can develop it in Java, C/C++, C# or what ever language you know.
What is constructor c++?
What is operators in c++?