which is the easy way to divide any integer by 2?

Answers were Sorted based on User's Feedback



which is the easy way to divide any integer by 2?..

Answer / rahul

int i = 10;
i = i >> 1;

Is This Answer Correct ?    15 Yes 0 No

which is the easy way to divide any integer by 2?..

Answer / saranya

if s=10
s=s>>1

Is This Answer Correct ?    5 Yes 1 No

Post New Answer

More C++ General Interview Questions

How does work in c++?

0 Answers  


What are the steps in the development cycle?

0 Answers  


why can't we declare data member of class auto register or extern

1 Answers  


Out of fgets() and gets() which function is safe to use and why?

0 Answers  


When the design recommends static functions?

2 Answers   Symphony,






What is an arraylist c++?

0 Answers  


How are pointers type-cast?

0 Answers   iNautix,


What are the advantages of c++ over c?

0 Answers  


What is constructor in C++?

0 Answers  


class X { private: int a; protected: X(){cout<<"X constructor was called"<<endl;} ~X(){cout<<"X destructor was called"<<endl} }; Referring to the code above, which one of the following statements regarding "X" is TRUE? a) X is an abstract class. b) Only subclasses of X may create X objects. c) Instances of X cannot be created. d) X objects can only be created using the default copy constructor. e) Only friends can create instances of X objects.

2 Answers   Quark,


Write a program to interchange 2 variables without using the third one.

0 Answers  


Write a program to find the Factorial of a number

0 Answers  


Categories