Program that numerically sums up the infinite series

Assignment Help C/C++ Programming
Reference no: EM13694911

Program: Write a C program that numerically sums up the infinite series: \(1 + \frac{1}{2^{2}}\frac{1}{3^{2}}\frac{1}{4^{2}}+...\) This is what I have so far, but its not working:

#include #include int main(){float i,n;float sum=0.0;printf("Enter the number of iterations =");scanf("%d", &n);for (i=1;i<=n;i++)sum= sum + 1/(i^(2));printf("The sum of the series is= %f.\n", sum);return 0;}

It must compile with no errors and follow the directions.

Reference no: EM13694911

Questions Cloud

Determining the value of the rate constant : Problem- The table gives the concentrations of NO2(g) as a function of time at a certain temperature for the following reaction
Prove or disprove formally : The number of leaf nodes (nodes with no children) in a perfect binary tree of height h is no more than 2h -
Define two buffer solutions have the same or different ph : Problem- 1. Student Q prepared 50.00 mL of a buffer solution using 0.50 moles of HA and 0.50 moles of A- while Student S prepared 50.00 mL of a buffer solution using 0.25 moles of HA and 0.25 moles of A-.
Write a method to get list of all the books : Make a map for a book with Book ISBN as key and book title as value - Write a method to get list of all the books in JSON format using restul client.
Program that numerically sums up the infinite series : Write a C program that numerically sums up the infinite series: \(1 + \frac{1}{2^{2}}\frac{1}{3^{2}}\frac{1}{4^{2}}+...\) This is what I have so far, but its not working:
Derive the integrated rate expression for a reaction : Problem- Derive the integrated rate expression for a reaction that is 1/2 order in {A}. Also, derive an expression for t1/2.
How much energy would it take to raise the temperature : Problem- The molar heat capacity of silver is 25.35 J/mol??C. How much energy would it take to raise the temperature of 11.8gof silver by 12.2?C
Write a function that prompts the user : Write a function that prompts the user to enter an integer. The program should use getline to read the user's input into a string. Then use the stringstream class to extract an integer from the string. If an integer cannot be extracted then the us..
The no molecule is a free radical and the unpaired electron : Problem- The NO molecule is a free radical, and the unpaired electron could be spin up (alpha) or spin down (Beta). This means that the electronic ground state has two degenerate states.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  What is the main research problem addressed in the article

Briefly discuss the body of literature that is used to motivate the research. You may need to review some of the key articles referenced by the authors. Identify any shortcomings in the prior literature that the article addresses.

  Prepare a linear support vector machine svm

Write a computer program to prepare a Linear Support Vector Machine SVM

  Program to output value of tenth component of array

Write a C++ statements to perform the following: Set value of fourth component of array alpha to three times  value of eight component minus 57.

  Create a template class

Create a template class, SVector, that implements a constructor

  Prompt the user for and read 6 numbers

Write a program using an array that will store input data. Prompt the user for and read 6 numbers between 70 and 90. Verify the numbers should be greater than 70 and less than 90. If the number is less than or equal to 70 or greater than 90, repro..

  Write a function called distance

Write a function called distance that takes two Points as arguments and returns the distance between them.

  Compute the time required to cut the grass

Write a program that takes the length and width of a rectangular yard and the length and width of a rectangular house situated in the yard.

  Generates a random number and asks the user

Write a program in c++ that generates a random number and asks the user to guess what the number is. If the user's guess is higher than the random number

  All the new strings generated

Explain why, if on some round, all the new strings generated for any syntactic category are longer than s, and s has not already been generated for L(), then s cannot ever be put in L(). Hint: Use Exercise 11.3.5.

  A linked list of your song structure in cd

The CD object should have a data member that is a linked list of your song structure that you have in CD.  The CD class needs a function that allows it to add a song to the object, that function would then append the song to that instance of the link..

  C program to mips program

Convert the following C program to MIPS program. Assuming that i, j, k, f, are stored in registers $s0, $s1, $s2, $s3 already.

  Create a c++ console application

Objective: Create a C++ console application that will model the characteristics of a resistor. Create a multifile project. Create and add to the project an h file containing the resistor-class definition. Create and add to the project a cpp file cont..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd