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
A tripod head can move vertically or horizontally. What term describes these movements?
AnnyKZ [126]

The term for vertical movement of a tripod is Tilt. The term for horizontal movement is Pan.

Vertical movement of the camera angle involves pointing the camera up and down. This sort of movement is achieved so as to follow a subject or show the top and bottom of a still object. With Tilt, you can show how tall objects are. On the other hand, the tripod’s horizontal movement is used for a smooth effect. Like Tilting, it shows a subject or show the distance from left to right between two objects. Pan shots are great for panoramic views .

7 0
4 years ago
Read 2 more answers
You install a new driver, but your device still doesn't work. What is the first thing you should do?
Lina20 [59]

restart the computer then contact customer service

7 0
3 years ago
The ACT science test takes___minutes.<br> A. 45<br> B. 30<br> C. 35<br> D. 60
Masja [62]

Answer:

a

Explanation:

8 0
3 years ago
Read 2 more answers
What is the name of the the world cell of the internet?​
kipiarov [429]
<h2>Mobile Web</h2>

How you even don't know the basic information

it's disgusting.

3 0
3 years ago
A palindrome is a string that reads the same from left to right and from right to left. Design an algorithm to find the minimum
stepladder [879]

Answer:

Explanation:

The following code is written in Python. It is a recursive function that tests the first and last character of the word and keeps checking to see if each change would create the palindrome. Finally, printing out the minimum number needed to create the palindrome.

import sys

def numOfSwitches(word, start, end):

   if (start > end):

       return sys.maxsize

   if (start == end):

       return 0

   if (start == end - 1):

       if (word[start] == word[end]):

           return 0

       else:

           return 1

   if (word[start] == word[end]):

       return numOfSwitches(word, start + 1, end - 1)

   else:

       return (min(numOfSwitches(word, start, end - 1),

                   numOfSwitches(word, start + 1, end)) + 1)

word = input("Enter a Word: ")

start = 0

end = len(word)-1

print("Number of switches required for palindrome: " + str(numOfSwitches(word, start, end)))

3 0
3 years ago
Other questions:
  • What is a Web application?
    12·1 answer
  • Which step of the machine cycle examines the op-code of the next instruction to be executed?
    12·2 answers
  • How did AI help in creating the Cognitive dress for Marchesa?
    5·1 answer
  • 1. The @ symbol is used to denote:​
    7·1 answer
  • What information may be obtained from a ResultSetMetaData object?(TCOs 1–6) What information may be obtained from a ResultSetMet
    9·1 answer
  • The most infuential programming language is ______.
    7·1 answer
  • ​ In addition to using national weather sites, you should supplement the local weather information with all of the following EXC
    12·1 answer
  • The methodology used by web project teams is usually:
    9·1 answer
  • Identify the final stage of the object found in the image in the given text
    9·1 answer
  • Ndcdeviceid?????????????????????​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!