1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Anettt [7]
3 years ago
12

Write program to calculate the sum of the following series where in is input by user. (1/1 + 1/2 + 1/3 +..... 1/n)

Computers and Technology
1 answer:
Lorico [155]3 years ago
3 0

Answer:

#here is code in Python.

#read the value n from user

n=int(input("enter the value of n:"))

#variable to store the total sum

sum_n=0

for i in range(1,n+1):

# find the sum of series

   sum_n=sum_n+1/i

#print the sum

print("sum of the series is: ",sum_n)

Explanation:

Read the value of n from user. Create and initialize a variable sum_n with 0. Run a for loop to calculate sum.Initially sum_n is 0, then for value of i=1  1/i will be added to the sum_n.Then in next iteration for i=1, 1/2 added to sum_n. Similarly loop will run util i equals to n.Then sum_n will store the sum of the

series.

Output:

enter the value of n:5

sum of the series is:  2.283333333333333

You might be interested in
Why does space exploration lead to new technology?
valentina_108 [34]

Answer:

C. Because materials developed for use in space are often useful to ordinary citizens.

Explanation:

A, is not correct due to the "only" word. Humans can explore space too.

B, not that either because you will need lots of technology to space travel, not less.

C, because materials that can be produced through scientists' ideas can help contribute to society and improve technology.

D, is not correct because there is no need for new materials for new technology.

5 0
3 years ago
Frankie used the ps command to find the process id of an application that he needs to stop. What command-line tool should he use
ASHA 777 [7]

In the case above, the command-line tool should he use to stop the application based on its process id is e option

What is the use of ps command?

The ps command is known to be one that helps enables a person to be able to look at the status of any kind of active processes on a system, and also that of display technical information in regards to the processes.

Note that In the case above, the command-line tool should he use to stop the application based on its process id is e option

Learn more about command-line tool from

brainly.com/question/3737699

#SPJ1

7 0
2 years ago
Consider the following code segment.
Gekata [30.6K]

Answer:

D

Explanation:

(n+n)(n+n)

(2n)^2

4n^2

8 0
3 years ago
How do i get my laptop to connect to wifi?​
Rina8888 [55]

Answer:

open your laptop go to the wifi or service icon. Look for your wifi and put in the password

4 0
3 years ago
Read 2 more answers
Where can the slide layout be changed?
max2010maxim [7]
Slide layout can be changed from the edit menu :)
6 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following are reasons why it is important to properly recycle electronic equipment? Select all that apply.
    14·2 answers
  • Which vpn protocol is a poor choice for high-performance networks with many hosts due to vulnerabilities in ms-chap?
    15·1 answer
  • What is the symbol that causes the computer to perform string concatenation?
    5·1 answer
  • Website hosting servers have their own unique IP address, what does this address consist of?
    8·1 answer
  • Write a calculator program that keeps track of a subtotal like real calculators do. Start by asking the user for an initial numb
    12·1 answer
  • My PC won't output any data does anyone have any ideas​
    9·1 answer
  • The backbone networks of the Internet are typically owned by long-distance telephone companies called
    12·1 answer
  • Give four example of computer virus​
    13·1 answer
  • If you want to change your system settings, what should you use
    5·1 answer
  • A common business practice is to include a worksheet named Documentation that contains a description of the workbook, the name o
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!