Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

For question one We should write it 3 times. Using 1)while, 2)fo,3) do ..while image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

More Books

Students also viewed these Databases questions

Question

Which form of proof do you find most persuasive? Why?

Answered: 1 week ago

Question

Do you currently have a team agreement?

Answered: 1 week ago

Question

c. How is trust demonstrated?

Answered: 1 week ago

Question

c. Will leaders rotate periodically?

Answered: 1 week ago