Write a program that finds the factorial value of a given number as shown. Display an appropriate error message if the number entered is negative, or too big for the answer to be correctly calculated.
Enter a non-negative integer : 5
5 x 4 x 3 x 2 x 1 = 120
3. Write a program that allows the user to input a monthly investment, annual rate of return (monthly rate is 1/12th) and number of months to track. The program will display the starting balance, interest earned, deposit and ending balance for each month. Here is a sample run :
Monthly Investment : 200
Annual Interest Rate (%) : 12
Term ( Months ) : 4
Starting Interest Monthly Ending
Balance Earned Deposit Balance
-------- -------- ------- -------
0.00 0.00 200.00 200.00
200.00 2.00 200.00 402.00
402.00 4.02 200.00 606.02
606.02 6.06 200.00 812.08
4. Create a simple game of HI-LO, where the computer picks a random number from 1 to 100 and the user guesses at it repeatedly until guessed correctly. After each guess, the computer will say "Higher", "Lower" or "Correct" and keep track of the number of guesses. You will need the following code to access random numbers.
#include<stdlib.h>
randomize(); should be inserted once at start of program
answer = random(100) + 1; will store a random number from 1 to 100 in variable answer