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 are the defining traits of an object-oriented language?

1 Answers  


Is c++ still in demand?

1 Answers  


Explain the differences between private, public and protected and give examples.

1 Answers  


What would happen on forgetting [], while deallocating an array through new?

1 Answers  


Perform addition, multiplication, subtraction of 2-D array using Operator Overloading.

1 Answers   Nucleus, TCS,


Write a code/algo to find the frequency of each element in an array?

1 Answers   Axtria,


There are 100 students in a class. The management keep information in two tables. Those two tables are given like Roll no Name Age 001 ABC 15 002 XYZ 14 and Roll No Subject Marks 001 Math 75 001 Physics 55 002 Math 68 001 Hindi 69 They want the information like this Roll No Name Hindi Physics Math Total 001 ABC 69 55 75 199 002 XYZ 68 74 84 226 And Roll No Suject Highest 001 Math 98 007 Physics 84 021 Hindi 74 All 275 All information is kept in structure in main memory. You have to find last two tables.

1 Answers  


How can we access protected and private members of a class?

1 Answers  


Explain the concept of copy constructor?

1 Answers  


What does it mean to declare a member variable as static?

1 Answers  


What is difference between class and function?

1 Answers  


Explain the pure virtual functions?

1 Answers  


Categories