show that among any group of five (not necessary consecutive
) integers, there are two with the same remainder when
divided by 4.



show that among any group of five (not necessary consecutive ) integers, there are two with the sam..

Answer / lalala

generalized pigeon principle: If N objects are placed into k
boxes, then there is at least one box containing at least (ceiling) N/k objects.

let k = 4 ;
find N:

N/4 = 2 , N= 5, in order to get the answer 2..

Is This Answer Correct ?    17 Yes 19 No

Post New Answer

More C++ General Interview Questions

Write a program to get the value of sin (x) using a library function , when x is given in degrees.

1 Answers  


what are Operators and explain with an example?

0 Answers  


How do I use turbo c++?

0 Answers  


What is late binding c++?

0 Answers  


Explain what are the sizes and ranges of the basic c++ data types?

0 Answers  






What is a c++ class?

0 Answers  


What is scope in c++ with example?

0 Answers  


Which one of the following describes characteristics of "protected" inheritance? a) The base class has access only to the public or protected members of the derived class. b) The derived class has non-public, inheritable, access to all but the private members of the base class. c) The derived class has access to all members of the base class. d) The private members of the base class are visible within the derived class. e) Public members of the derived class are privately accessible from the base class.

4 Answers   Quark,


Which field is used in c++?

0 Answers  


int main() { int i ,a[i]; i = 0; a[i] = 10; cout<< a[i] << endl; return 0; } What will be output of this program?

11 Answers   HCL, Mphasis,


What is increment operator in c++?

0 Answers  


What are Virtual Functions? How to implement virtual functions in "C" ?

3 Answers  


Categories