subject

Make a function called half() that takes an integer argument. The function must print the number it received to the screen, then the program should divide that number by two to make a new number. If the new number is greater than zero, the function then calls itself (the function half()) passing it the new number as its argument. If the number is zero or less, then the function exits. (This technique is called recursion.)

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 21:00
Which task uses a simple parameter?
Answers: 1
question
Computers and Technology, 24.06.2019 04:10
Write a program that reads a set of floating-point values. ask the user to enter the values, then print • the average of the values. • the smallest of the values. • the largest of the values. • the range, that is the difference between the smallest and largest. of course, you may only prompt for the values once.
Answers: 3
question
Computers and Technology, 24.06.2019 12:30
Nikki sent flyers in the mail to all houses within the city limits promoting her computer repair service what type of promotion is this and example of
Answers: 1
question
Computers and Technology, 24.06.2019 21:30
Aobject is used for displaying the results of a question based on stored data. a. query b. report c. table d. form
Answers: 2
You know the right answer?
Make a function called half() that takes an integer argument. The function must print the number it...
Questions
question
English, 22.12.2019 01:31
question
Mathematics, 22.12.2019 01:31
Questions on the website: 13722361