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
Arlecino [84]
3 years ago
5

Write C code that does the following: 1. Numerically compute the following series 1−13+15−17+..=????4 and approximate π. Vary it

eration numbers. Note that the general term, an, is expressed as ????????=(−1)????+12????−1

Engineering
1 answer:
yulyashka [42]3 years ago
3 0

Answer:

Explanation:

See attachment for the screen shot of the code.

//Sample Output

nter the numberof iterations4 The sum of the series is0.723810

//Code to copy

#include<stdio.h>

int main()

{

// Declare and initialize the Variables

int i, n;

int sign_flag = 1;

double sum = 0.0;

// Taking the number of iteration as input

printf("Enter the number of iterations ");

scanf("%d", &n);

// Sum upto n terms

// Sign flag is used for alternate positive and negative terms

for (i = 1; i <= n; i++)

{

sum = sum + sign_flag*(1.0 / (2 * i - 1));

sign_flag = -sign_flag;

}

// Print the sum

printf("The sum of the series is %lf\n", sum);

return 0;

}

You might be interested in
Why does the ring on saturn spin
spayn [35]

Answer: THERE IS NO GRAVITY IN SPACE SO ROCKS SPIN

Explanation:

8 0
3 years ago
Read 2 more answers
Assume that the water temperature is 10°C and the depth of the settling tank is 3.0 m (9.80 ft). Calculate the theoretical settl
Lelu [443]

Explanation:

See attached file

6 0
3 years ago
PLZZ HELP
9966 [12]

Answer:

Could ask a family member to help

Explanation:

5 0
3 years ago
Read 2 more answers
Both model building codes and NFPA __________ can be used to determine the type of construction used in a building.
Alex777 [14]

Answer:

Both model building codes and NFPA 220 can be used to determine the type of construction used in a building.

8 0
3 years ago
What is capillary action?
BARSIC [14]
Capillary action occurs When the adhesion to the walls stronger than dirt cohesive forces between a liquid molecules. the head towards Capillery action will take water in a uniform circular is limited by surface tension and, of course, gravity.
4 0
2 years ago
Other questions:
  • Researchers compared protein intake among three groups of postmenopausal women: (1) women eating a standard American diet (STD),
    14·1 answer
  • A steady state and continuous separator has a total feed rate of 100. kg/h of a 55.0 wt. % benzene mixture. The balance is tolue
    7·1 answer
  • There are a number of requirements that employers must do to protect their workers from caught-in or
    12·1 answer
  • A piston-cylinder assembly has initially a volume of 0.3 m3 of air at 25 °C. Mass of the air is 1 kg. Weights are put on the pis
    15·1 answer
  • It is possible to have liquid water at 200°C. a)-True b)- False
    14·1 answer
  • Of the core elements of successful safety and health programs,management leadership,worker participation and what else directly
    6·1 answer
  • Thoughts about drinking and driving
    12·2 answers
  • On calculating which of the following quantities , does the body have an effect in simple projectile motion?​
    10·1 answer
  • Why is California a good place for engineers to build suspension bridges?
    12·1 answer
  • Why is the reflection step in the engineering process the most important step?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!