Question: You will be creating a main() function to practice basic loops, basic user inputs, and basic outputs. You will submit ONE file on Canvas called

You will be creating a main() function to practice basic loops, basic user inputs, and basic outputs. You will submit ONE file on Canvas called LastName_Firstname_HW1F.cc (or.cpp). Instructions: 1. Prompt a user to type in a positive integer from the keyboard. (Examples: 1, 2, 5, 10, 15) 2. Compute sum1 = 1/12 + 1/22 + 1/32 + + 1? Use float to compute your answer. Note that this will result in a maximum accuracy of 7 digits. 3. Instead of printing this sum (approximately 1.64) compute the following expression: result1 = sqrt(6 * sumi) In order to use the sqrt function you will have to #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
