Write a program for Fibonacci series for n terms where n is the user input.
Program for Fibonacci series for n terms with user input.
Take user input for n
Initialize variables for first two terms of Fibonacci series
Use a loop to generate the series up to n terms
Print the serie...read more
here is the program in java:public class Fibonacci { public static void main(String args[]){ int n1=0,n2=1,n3,a,count=15; System.out.println(n1+" "+n2); for(a=2;a<count;++a){ n3=n1+n2; System.out.prin...read more
here is the program in java:public class Fibonacci { public static void main(String args[]){ int n1=0,n2=1,n3,a,count=15; System.out.println(n1+" "+n2); for(a=2;a<count;++a){ n3=n1+n2; System.out.prin...read more
fibonacci series in which number is series related term,.
for eg
n n n+n n+n+n n+n+n+n
Here’s a program in python
n = int(input("Enter the number of terms: ")) # Get input from user
# First two terms of the sequence
a = 0
b = 1
# Initialize a counter variable
count = 0
# Check if the number of...read more
import java.util.Scanner;
public class Main
{
Scanner sc=new Scanner(System.in);
public static void main(String[] args) {
System.out.println("Welcome to Online IDE!! Happy Coding :)");
Scanner sc=...read more
Top TCS Software Engineer interview questions & answers
Popular interview questions of Software Engineer
Top HR questions asked in TCS Software Engineer
Reviews
Interviews
Salaries
Users/Month