class Main { public static int fib(int n){ int fn = 1; int fn_1 = 0; for(int i=0; i<n; i++) { int t = fn; fn = fn + fn_1; fn_1 = t; } return fn; } public static void main(String[] args) { System.out.println(fib(5)); } }