Full question:
You are standing in a corridor with N closed doors. The person walks by you and opens every door. Then the second person walks by an ...
Search results for integer
Prints odd numbers less than N
Posted by aleksin
Question:
Write recursive method that for a positive integer n prints odd numbers
Answer:
I usually use binary check to solve this type of questions ...
Endianness is the attribute of a system that indicates whether integers are represented with the most significant byte stored at the lowest address or ...
Write a function that sums up integers from a text file, one int per line.
Posted by CMaster (http://sites.google.com)
Answer in Java
public static void sumFile ( String name ) { try { int total = 0; BufferedReader in = new BufferedRead ...
How do you get the line numbers in C?
Posted by CMaster
Answer:
There are number of useful predefined macros which are part of the C/C++ standard. During preprocessing, they are replaced respectively by a ...
Fibonacci numbers interview questions
Posted by aleksin
One of most common question from this area is to write a function which return Nth number of Fibonacci sequence.
Fibonacci numbers are a sequence of n ...
Write a function which produces a random integer in the range 1 to 7 based on function which returns random integer in the range 1 to 5
Posted by CMaster
The task is given a function rand5() which produces a random integer in the range 1 to 5, write a function rand7() which produces a random integer in ...
Company where asked this question: Google, Microsoft
Company where asked this question: Google, Microsoft
Self defining number
Posted by aleksin
Write a function or find a logical way of finding a number X1X2X3... such that
X1 is the amount of zerror's in the number
X2 is the amount of one's
X3 ...
