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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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