**Question:**

A class **Fibonacci_Recursion** has been defined to find the Fibonacci series upto a limit. Some of the members of the class are given below:

**Class Name :** Fibonacci_Recursion

**Data Members/instance variables :** a, b, c, limit (all integers)

**Member functions/methods :**

**Recursion() :** constructor to assign a,b,c with appropriate values.**void input() :** to accept the limit of the series.**int fib(int n) :** to return the **nth** Fibonacci term using** recursive technique**.**void genearate_fibseries() :** to generate the Fibonacci series upto the given limit.

Specify the class **Fibonacci_Recursion** giving details of the **constructor**, **int fib()** , **void generate_fibseries()**. You may assume other functions are written for you and you need not write the main function.

**Programming Code:**

/** * The class Fibonacci_Recursion prints the Fibonacci Series upto ‘n’ terms using the concept of Recursion * @author : www.guideforschool.com * @Program Type : BlueJ Program – Java * @Question Year : ISC Theory 2005 Question 12 */ import java.util.*; class Fibonacci_Recursion { int a,b,c,limit; Fibonacci_Recursion() { a=0; b=1; c=0; limit=0; } void input() { Scanner sc = new Scanner(System.in); System.out.print("Enter the limit : "); limit = sc.nextInt(); } int fib(int n) { if(n<=1) return a; else if(n==2) return b; else return (fib(n-1)+fib(n-2)); } void generate_fibseries() { System.out.println("The Fibonacci Series is:"); for(int i=1;i<=limit;i++) { c=fib(i); System.out.print(c+" "); } } public static void main(String args[]) { Fibonacci_Recursion ob = new Fibonacci_Recursion(); ob.input(); ob.generate_fibseries(); } }

**Output:**

Enter the limit : 11

The Fibonacci Series is:

0 1 1 2 3 5 8 13 21 34 55

Enter the limit : 20

The Fibonacci Series is:

0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181

nice program…

can you please write the programs for factorial and gcd of a number using recursion

Kindly go through these : http://www.guideforschool.com/372-collection-of-number-based-programs-using-recursion-isc-computer-science/

and

http://www.guideforschool.com/345-collection-of-string-programs-using-recursion-isc-computer-science/

I am very much glad as I have got maximum answers from this websites regarding programs.

I am very happy to visit this website and get the answers.