Question: For question one We should write it 3 times. Using 1)while, 2)fo,3) do ..while T-Mobile :44 AM 61%) PE5.docx dcccd.blackboard.com 5-1: Counting with Loops Write
T-Mobile :44 AM 61%) PE5.docx dcccd.blackboard.com 5-1: Counting with Loops Write a program that inputs a number greater than or equal to 0. The program should then count from 0 to the number inputted using a for-loop, a while-loop, and a do...while loop. If the user's input is not greater than or equal to 0, display an error message and require the user to try again until they get it right. 5-2: Factorial Let n be a nonnegative integer. The factorial of n, written n! is defined by 0' =l, n' = 1x2x3 n ifn 01 For example, 4-1x2x3x4-24. Write a prograrm that prompts the user to enter a nonnegative integer and outputs the factorial of the number, then find the approximate value of the number e using the read input as n in the approximating equation below (e is an irrational number=2.718281827. used in exponential growth and decay problems) Run the output for at least n=20, n=50 G
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
