how to write aprogram which reads three numbers and writes t