1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
faltersainse [42]
3 years ago
15

The Fibonacci numbers are the numbers

Computers and Technology
1 answer:
Doss [256]3 years ago
6 0

Answer:

function fibonacci(n):

  if n is equal to 1 or n is equal to 2:

       return 1

  else:

       return fibonacci(n-1) + fibonacci(n-2)

end of the function

Input the n

Print fibonacci(n)

Explanation:

* The above algorithm (pseudocode) is written considering Python.

Create a function called fibonacci that takes one parameter, n

If n is equal to 1 or 2, return 1 (When n is 1 or 2, the fibonacci numbers are 1)

Otherwise, return the sum of the two previous numbers (When n is not 1 or 2, the fibonacci number is equal to sum of the two previous numbers)

Ask the user for n

Call the function, pass n as a parameter and print the result

You might be interested in
The process of encoding messages or information in such a way that only authorized parties can read it is called ____________.
lukranit [14]

Answer:

Encryption

Explanation:

Encryption is a term in the field of computer security (Cryptology) this is a process of encoding information in a way that hackers and eavesdroppers cannot read. The process of encryption involves a plain text (message) been converted into a scrambled text (cipher text) with an encryption algorithm (key) in this way, if the message is intercepted by a hacker he/she is unable to read the contents. Only the authorized party with a decryption key will be able to decrypt back to a plain text and read the contents of the message

3 0
2 years ago
Which device on a network performs network address translation?
Alika [10]
Network Address Translation<span> (NAT) is the answer</span>
4 0
3 years ago
In Excel, you can sort a table by one or more columns by.
timofeeve [1]
Ushsbcjdiosjdhwjwjif math
8 0
3 years ago
Write a recursive function num_eights that takes a positive integer pos and returns the number of times the digit 8 appears in p
nata0808 [166]

Answer:

Explanation:

The following is written in Java. It creates the function num_eights and uses recursion to check how many times the digit 8 appears in the number passed as an argument. A test case has been created in the main method and the output can be seen in the image below highlighted in red.

  public static int num_eights(int pos){

       if (pos == 0)

           return 0;

       if (pos % 10 == 8)

           return 1 + num_eights(pos / 10);

       else

           return num_eights(pos / 10);

   }

7 0
2 years ago
I need some cool things to do with windows command prompt.
STatiana [176]
I programmed in batch before so I know a lot of things!

You can ping a website to test your latency.

ping google.com

I have a ton of tricks in cmd (Command Prompt). Message me if you want.





7 0
3 years ago
Other questions:
  • Windows enables each user to establish a ____, which identifies to windows the resources, such as apps and storage locations, a
    6·1 answer
  • Which function can you use to abbreviate the lengthy expression, A1+A2+A3+A3...+A19+A20?  MAX COUNT SUM ROUND
    10·2 answers
  • List of programming languages and their typing
    5·2 answers
  • What type of topology gives you a direct connection between two routers so that there is one communication path?
    14·1 answer
  • Systems Software, Inc., is introducing a new piece of sophisticated graphics software. A recently hired writer has been assigned
    8·1 answer
  • Select what's true about Search Engine Companies. Check All That Apply The information contained in a search engine database is
    12·1 answer
  • Jared recently sent an email to all the members of his department asking them for their opinions about where the department shou
    11·1 answer
  • You entered the following line of code in IDLE.
    15·2 answers
  • Difference between statement x=+5 and x+=5​
    7·1 answer
  • Which of the following is not part of the processes involved in data valida
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!