I need to to write a Java code that checks whether the user inputed number is in the Fibonacci sequence.
I have no issue writing the Fibonacci sequence to output, b
Consider the sequence of Fibonacci numbers 1,1,2,3,5,8,13,21, etc. It is desired to build 3 stacks each of capacity 10 containing numbers from the above sequences as follows:
Stack 1: First 10 numbers from the sequence. Stack 2: First 10 prime numbers from the sequence. Stack 3: First 10 non-prime numbers from the sequence.
(i) Give an algorithm of the flowchart (ii) Write a program (in BASIC, C++ or Java) to implement this.
Output:As stack operations take place you should display in any convenient form the 3 stacks together with the values held in them.