IBM interview question

Write the code logic for fibonacci program.