232k views
4 votes
Which of the following is true of functions?

A. Functions are called once but can be declared many times
B. Replacing repeated code with a function will reduce the number of commands the computer needs to run
C. Programs written with functions run more quickly
D. Functions can help remove repeated code from a program

User Scyuo
by
4.4k points

1 Answer

1 vote

Answer:

only D.

Step-by-step explanation:

A is false because you can only declare it once, then call it multiple times.

B is false does not affect the number of commands. You can expect that the function commands are run multiple times.

C is false because the amount of work the program has to do does not change.

D is spot on.

User Samps
by
4.7k points