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

What's the hardest coding language?

0 Answers  


How can you quickly find the number of elements stored in a dynamic array?

0 Answers  


What are the four partitions in which c++ compiler divides the ram?

0 Answers  


What does the ios::ate argument do?

0 Answers  


What is an adaptor class or wrapper class in c++?

0 Answers  


Can you be able to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?

0 Answers  


Live example for static function?

1 Answers   Infosys,


What is the difference between an array and a list?

0 Answers  


what is data Abstraction? and give example

147 Answers   Aaditya Info Solutions, American Express, CMS, College School Exams Tests, Data Entry Operator, First Advantage, Google, HCL, IBM, Infosys, Microsoft, Mind Links, NIIT, Oracle, Pact, QBit Systems, TCS, WAYA, Wipro,


which of the following is not an secondary constant a) array b) real c) union

0 Answers  


What is this pointer in c++?

1 Answers  


Is java made in c++?

0 Answers  


Categories