Cubiware interview question

Write program in C that will return a part of given length from given binary stream, starting from given bit.