Recursive Fibonacci Program
How the code works
Code asks for user input and the user inputs the number of the fibonacci sequence which they want to know. The code then runs the Fibonacci method with the first number being set to 0, and the second number being set to 1, it also sets the stack which the method is currently on which at this point is 1, then the final and fourth variable that is set is the place in the fibonacci sequence that the user is looking for. It then checks if the stack number is equal to the fibonacci place that the user is looking for. If they are equal it prints the value that first num is currently at then skips a line and writes a sentence about what the value of the place the user was looking for is. If the first if statement didn't work it goes on to write what first num is currently at and then runs the fibonacci method again with the first variable being the second num, the second variable being first num + second num, the third number being stack number + 1, and the fourth variable being the fibonacci place value the user is looking for. And it keeps calling the fibonacci method until stack number is equal to fibonacci place.
Psuedo Code Iterative
Ask for user input #, save as variable
Make a counter variable saved as 0
Make a first number variable saved as 0
Make a second number variable saved as 1
Make a while loop that works while counter variable is > the user input
Print the first number
Make a third number variable saved as first number plus second number
Set first number equal to second number
Set second number equal to third number
Add one to counter
Code asks for user input and the user inputs the number of the fibonacci sequence which they want to know. The code then runs the Fibonacci method with the first number being set to 0, and the second number being set to 1, it also sets the stack which the method is currently on which at this point is 1, then the final and fourth variable that is set is the place in the fibonacci sequence that the user is looking for. It then checks if the stack number is equal to the fibonacci place that the user is looking for. If they are equal it prints the value that first num is currently at then skips a line and writes a sentence about what the value of the place the user was looking for is. If the first if statement didn't work it goes on to write what first num is currently at and then runs the fibonacci method again with the first variable being the second num, the second variable being first num + second num, the third number being stack number + 1, and the fourth variable being the fibonacci place value the user is looking for. And it keeps calling the fibonacci method until stack number is equal to fibonacci place.
Psuedo Code Iterative
Ask for user input #, save as variable
Make a counter variable saved as 0
Make a first number variable saved as 0
Make a second number variable saved as 1
Make a while loop that works while counter variable is > the user input
Print the first number
Make a third number variable saved as first number plus second number
Set first number equal to second number
Set second number equal to third number
Add one to counter