tranlsated example 10 to C