Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Fibonacci
- {
- public static void main(String args[])
- {
- Scanner input = new Scanner(System.in);
- System.out.println("Welcome to Fibonacci Program!");
- System.out.print("\nEnter a number: ");
- long num = input.nextLong();
- long fibonacciNumber = findFibonacci(num);
- System.out.println("\nThe fibonacci number of " + num + " is " + fibonacciNumber + ".");
- if(num > 1426)
- System.out.println("Sorry! The maximum allowed number is 1426.");
- }
- static long findFibonacci(long n)
- {
- if(n == 0)
- return 0;
- else if(n == 1)
- ...............................
- Downlode full project from Here :::
- http://tmearn.com/NwCx
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement