Monday, January 24, 2022

fibonacci series of first 10 element

                 int f1 = 0, f2 = 1;

int f3 = 0;

System.out.print(f1+" ");

System.out.print(f2+" ");

for (int i = 1; i <=8; i++) {

f3 = f1 + f2;

System.out.print(f3+" ");

f1 = f2;

f2 = f3;

}

No comments:

Post a Comment

Fluent interface pattern

 public class UserConfigurationManager {     private String userName;     private String password;     private UserConfigurationManager() { ...