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
Is c++ a low level language?
What is an html tag?
Can I learn c++ as my first language?
How can you quickly find the number of elements stored in a dynamic array? Why is it difficult to store linked list in an array?
Why we use #include conio h in c++?
What is std namespace in c++?
What is the oldest programming language?
What is a terminating character in c++?
Explain the uses of static class data?
Difference between a homogeneous and a heterogeneous container
How do you add an element to a set in c++?
What c++ is used for?
Should you pass exceptions by value or by reference?
What is an overflow error?
Can member data be public?