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]
2 years ago
8

Write a function to sum the following series:

Computers and Technology
1 answer:
Phoenix [80]2 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
Zohan uses the following analogy to describe a concept of object-oriented programming. A button can have many uses. When it is p
Vika [28.1K]

Answer:

Polymorphism

Explanation:

You can have a basic button class that gets inherited by other classes.

class Button {

function pushButton(){}

}

class ElevatorButton extends Button{};

class BigRedButton extends Button{};

With these new classes, they inherit from the basic button class. They can decide what happens when the method pushButton() is called.

You don't need to worry about what pushButton() actually does, you can just call it if the object is of the type "Button" and you can expect it to work.

4 0
2 years ago
What kind of operating system is MS-DOS?
ELEN [110]

MS-DOS is a command-line operating system.

Therefore, the best answer is Command-line.

8 0
3 years ago
Read 2 more answers
This graph shows a relationship between the height of a giraffe and its weight which term describe the dashed line through the g
Nadusha1986 [10]

Answer: The Answer is C

Explanation: This is because It is mainly controlled by genetics and we can not manipulate genetics.

4 0
3 years ago
Read 2 more answers
Which of the following would increase the Demand for jam?
gladu [14]
The answer would be B. An increase in the price of a complement.
8 0
2 years ago
Which option re-scales a worksheet vertically?
Brrunno [24]
Rescaling or if that didn’t help use quicker
3 0
3 years ago
Other questions:
  • If you were going to construct a table that only included shape names with number prefixes, which shape would you include
    11·1 answer
  • When discussing the data-modeling building blocks, anything (a person, a place, a thing, or an event) about which data are to be
    15·1 answer
  • The command-line interface tells a user that it's ready to receive commands by displaying a specific set of characters called a(
    12·1 answer
  • Cynthia realized that she used a wrong term throughout her paper. Which option can help her quickly correct her mistake?
    5·1 answer
  • What is the web of trust
    7·2 answers
  • Write a static method called split that takes an ArrayList of integer values as a parameter and that replaces each value in the
    12·1 answer
  • PLZZZZZZZZZZ HELP ME OUT THIS DUE TODAY AND NEED SOMEONE HELP!!!!!plzzzzzzzzzzz i begging you!!!
    11·1 answer
  • Frrrrrrrrrrreeeeeeeeee brainliest for u
    13·2 answers
  • What is computer specification
    15·1 answer
  • An internet ________ is a collection of utility programs designed to maintain your security and privacy while you are on the web
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!