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
Kruka [31]
3 years ago
8

Write a function to sum the following series:

Computers and Technology
1 answer:
Phoenix [80]3 years ago
5 0

Answer:

<u>C program to find the sum of the series( 1/2 + 2/3 + ... + i/i+1)</u>

#include <stdio.h>

double m(int i);//function declaration  

//driver function

int main() {

int i;

printf("Enter number of item in the series-\n");//Taking input from user

scanf("%d",&i);

double a= m(i);//Calling function

printf("sum=%lf",a);

return 0;

}

double m(int i)//Defining function

{

double j,k;

double sum=0;

for(j=1;j<i+1;j++)//Loop for the sum

{

k=j+1;

sum=sum+(j/k);

}

return sum;

}

<u>Output:</u>

Enter number of item in the series-5

sum=3.550000

You might be interested in
Alcohol is a gateway drug. true or false?
Llana [10]
Yes because when you are continued or addicted to a certain drug (alcohol) you can get addicted to harder substances
8 0
3 years ago
Read 2 more answers
Servlet session and JSP session have differentabilities.<br>? True<br><br>? False
xxTIMURxx [149]
Your answer is true your welcome!
5 0
4 years ago
4.8 Code Practice: Question 1
Furkat [3]

Answer:

c = 1 # global variable

    jhjl jh

def add(): c = 1 # global variable

def add():

   print(c)

add()

   c = c + 2 # increment c by 2

   print(c)

add()

Explanation:

4 0
2 years ago
Read 2 more answers
Canada’s energy plan, named __________, makes three governmental agencies accountable for safeguarding Canada’s environment.
stepan [7]

Answer:

Canada launched the national Generation Energy Council of leading Canadians, who proposed principles to the Government of Canada on how to build our energy future. Today, these principles guide government decisions to support Canadian families, businesses, and communities. Together, we are: saving energy powering clean communities.

Explanation:

8 0
2 years ago
Which programming model is distinct from the others discussed because it focuses on the data, or object, rather than the logic,
DIA [1.3K]
The programming model that is distinct from the others discussed because it focuses on the data, or object, rather than the logic, or function is object-oriented programming.
4 0
3 years ago
Other questions:
  • What is called photo and video edition?
    8·1 answer
  • Electronic files created on a computer using programs such as word software are considered to be
    15·1 answer
  • What sends massive amounts of email to a specific person or system that can cause that user's server to stop functioning? mail b
    6·1 answer
  • The energy used by an appliance which operates at 240 volts at 15 amp for 4 hr. is A. 0.92 kwhr. B. 3.45 kwhr. C. 14.4 kwhr. D.
    8·1 answer
  • Which of the following is the answer?
    5·1 answer
  • Why would Network Systems employees be employed by the government?
    12·2 answers
  • This is a python program.
    6·1 answer
  • An eReader has a 956-pixel x 1290-pixel grayscale display with each pixel able to display 32 shades of gray. What is the KiB siz
    9·1 answer
  • What are styles? built-in conditional formatting rules formatting applied with the Format Painter defined combinations of format
    15·2 answers
  • Write a program. in QBAsSIC
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!