import java.util.Scanner; class Fabonacci { public static void main(String[] args) { // declare variable int FirstNumber,SecondNumber; // initialize variable FirstNumber = 1; SecondNumber = 1; //taking input from user using Scanner class System.out.println("Plase Enter Number For Generate Fabonacci Series"); Scanner scan = new Scanner(System.in); int Val = scan.nextInt(); while(FirstNumber < Val) { System.out.println(FirstNumber); FirstNumber = FirstNumber + SecondNumber; SecondNumber = FirstNumber - SecondNumber; } } }
I am a self starter and also a quick learner. I'm an active proponent of Modern Software development Languages.I am highly motivated, with ambitions to work for a company whose high standard match my own. I am conscientious and experienced in all aspects of software development.
Tuesday, 3 January 2017
Fibonacci Series in Java
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment