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 the function half() passing it the new number as its argument. If the number is zero or less than the function exits
Call the function half() with an argument of 100, the screen output should be
100
50
25
...
...
1.
His code, is supposed to be in a function, not main. Also, you dont need to put return 0 anymore. And it should not be a while loop, it should be an if statement. And in that if statement, you have to call the function. So the function will be called and divide the number n, print it out, over and over again until the if statement is false (n is less than 0) and it'll exit.