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

  Write c program to read one ip address

Write a C or C++ program which Read one IP address at a time from Dec_IPAddresses.txt and convert it into Hex. Store converted values stored in another file (e.g. HEX_IPAddresses.txt).

  Definitions of the class circularlinkedlist

Write the definitions of the class circularLinkedList and its member functions. (You may assume that the elements of the circular linked list are in ascending order.)

  Write an interactive program that prompts for a desired sum

Write an interactive program that prompts for a desired sum, then repeatedly rolls two six-sided dice until their sum is the desired sum. Here is the expected dialogue with the user.

  Write c program that will input two values from the user

write c program that will input two values from the user with a prompt ? that are a value and a base with which you

  Wave steepness is the ratio of wave height

Wave steepness is the ratio of wave height (WH) to wave length(WL) and is an indicator of wave stability. When wave steepness exceeds a 1/7 ratio; the wave becomes unstable and begins to break. Assume a data file exits with the following header

  Design and implement a c++ program for find friends

MCS2514Pgm1- Design and implement a C++ program that will help find friends according to a defined method. In particular, your program will find and display the ten people in database who answered a set of survey questions closest to what the user..

  Write a function named sort3

Write a function named "sort3" that takes three floating point arguments, call them "x" , "y" , and "z" , and modifies their values, if necessary, in such a way as to make true the following inequalities: x y z .

  Deal two cards at a time

Deal two cards at a time, print them out.- Check if they are identical, have just the same rank or just same suit or are completely.different. Print out a message indicating the result of your comparison.

  Write a program that displays the cubes of the numbers

Write a program that displays the cubes of the numbers from 1 to 10. Recall that the cubes of a number is just the number multiplied by itself and then by itself again.

  Write a complete c program to do the following1 the main

write a complete c program to do the following1. the main program will read in a parameter value n read this in main.

  Write a function to arrange 10 numbers stored in an arraye

Writ a funtion to arrange 10 numbers stored in an array forom the largest to the smallest and pass the results to main program.

  Computers have trended to larger word

Since the beginning, computers have trended to larger word sizes, 8 to 16 to 32 and now some 64 bit computers. Explain a pro or a con in a computer with a larger word size, or comment on someone else's pro or con.

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