Fibonacci Series Program
For other basic java program click the given link. https://wordpress-343193-1101484.cloudwaysapps.com/solved-programs-class-9-beginner
Fibonacci series is a series of numbers in which each number is the sum of the two preceding numbers. For example 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987 ..more
Write a program to print the Fibonacci series. Accept a number from the user and print the Fibonacci series up to that number.
For other basic java program click the given link.
Solved Programs (class 9-Beginner Level)
// series of numbers in which each number is the sum of the two preceding //numbers.0,1, 1, 2, 3, 5, 8.....
import java.io.*;
class fibonacci
{
public static void main()throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter a number of your choice");
int n=Integer.parseInt(br.readLine());
int a=0,b=1;
int sum=0;
System.out.print(a+",");
System.out.print(b+",");
while(sum<=n)
{
Output:=a+b;
System.out.println(sum+",");
a=b;
b=sum;
}
}
}Output:Enter a number of your choice
5
0,1,1,2,3,5
To learn how to install Bluej watch the video https://youtu.be/i845Tz5_QXU
Related Posts
Continue learning with these related articles

String Methods in Java for ICSE Class 10: 25 Output Questions with Answers
ICSE Class 10 Computer Applications practice on String class methods: length, charAt, indexOf, lastIndexOf, substring, replace, trim, compareTo, equals and more, with 25 board-style output questions and step-by-step answers.

Special Number Programs in Java for ICSE: Armstrong, Spy, Neon, Disarium, Pronic and More
Every special number asked in ICSE Computer Applications – prime, perfect, Armstrong, palindrome, automorphic, neon, spy, Niven, duck, buzz, Disarium, special and pronic numbers – with definitions, examples and one complete Java program that checks them all.

Math Library Methods in Java for ICSE Class 9 (with Outputs)
ICSE Class 9 Computer Applications notes on the Java Math class: sqrt, cbrt, pow, abs, max, min, ceil, floor, round, rint and random, with return types, tricky negative-number outputs and Java expressions for formulas.