Write a program for Fibonacci series for n terms where n is the user input.

AnswerBot
1y

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

Bandari Swathi
1y

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

Urmilasiri Sura
1y

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

Anonymous
1y

fibonacci series in which number is series related term,.

for eg

n n n+n n+n+n n+n+n+n

Aparna Salunke
1y

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

Ridhi Jain
2y

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

Add answer anonymously...
TCS Software Engineer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter