subject

Write a program to ask the user to enter a number and display its square root. If the user enters a negative number, your program should ask the user to re-enter the number again repeatedly until the user finally enters a zero or a positive number. Then your program shall display its square root. You may assume that the user only enters a number, not letters or symbols. Therefore there is no input failure. (30%) Hint: (1) Use a while loop or a do-while loop for the repetition. (3) The square root function sqrt() is defined in cmath.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 05:30
The total revenues for a company are $150,223 and the total expenses were 125,766. if you are calculating the net income, which of these spreadsheets would you use? insert a spreadsheet with $150,223 in cell b2 and 125, 766 in cell b3. enter a formula =b2-b3. the formula should be showing in the formula bar. insert a spreadsheet with $150,223 in cell b2 and 125, 766 in cell b3. enter a formula =b2+b3. the formula should be showing in the formula bar. insert a spreadsheet with $150,223 in cell b2 and 125, 766 in cell b3. enter a formula =b2/b3. the formula should be showing in the formula bar. insert a spreadsheet with $150,223 in cell b2 and 125, 766 in cell b3. enter a formula =b2*b3. the formula should be showing in the formula bar.
Answers: 3
question
Computers and Technology, 23.06.2019 09:30
Name the range function that would generate the following list of integers values: 0,1,2,3,4,5.
Answers: 1
question
Computers and Technology, 24.06.2019 07:00
You are most likely to automatically encode information about
Answers: 1
question
Computers and Technology, 24.06.2019 09:00
Why might you chose to crest a function resume
Answers: 1
You know the right answer?
Write a program to ask the user to enter a number and display its square root. If the user enters a...
Questions
question
Mathematics, 21.04.2020 23:02
question
Mathematics, 21.04.2020 23:03
question
Biology, 21.04.2020 23:03
question
Mathematics, 21.04.2020 23:04
question
Mathematics, 21.04.2020 23:04
Questions on the website: 13722359