Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

import java.util.Scanner; public class Fibonacci 5 public static void main(String args) 6 7 Scanner input new Scanner (System.in i System.out.print(How many numbers do you want

image text in transcribed
import java.util.Scanner; public class Fibonacci 5 public static void main(String args) 6 7 Scanner input new Scanner (System.in i System.out.print("How many numbers do you want to have in the sequence?"): 12 int number input.nextInt); 1 13 4 to skip odd number?1n 1-Yesin 2-Noln") 15 int choice input.nextInt): 16 17 if(choice 2) 18 t 19 int x1 20 int x2 1; 21 int x3 1; 22 System.out.println("1\t"+x1); 23 System.out.println("2\t"+x2) 24 for(int i-; ic(number-2): 1+) 25 x3 x1+x2; 26 System.out.print((1+3)+t"); 27 System.out.println(x3): 28 x1 x2; 29 x2 x3; 30 31 32 questions System.out.print("Do you want na

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions