subject

The value of π can be approximated by using the following series: the following program uses this series to find the approximate value of π. however, the statements are in the incorrect order, and there is also a bug in this program. rearrange the statements and also find and remove the bug so that this program can be used to approximate π. #include #include using namespace std; int main () { double pi = 0; long i; long n; cin > > n; cout < < "enter the value of n: "; cout < < endl; if (i % 2 == 0) pi = pi + (1 / (2 * i + 1)); else pi = pi ? (1 / (2 * i + 1)); for (i = 0; i < n; i++) { pi = 0; pi = 4 * pi; } cout < < endl < < "pi = " < < pi < < endl; return 0; }

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 10:00
Now, open this passage to read about fafsa requirements. describe the information you will need to provide in order to complete a fafsa. list at least three of the required documents you must include.
Answers: 3
question
Computers and Technology, 23.06.2019 21:00
Which set of steps will organize the data to only show foods with more than 100 calories and rank their sugar content from greatest to least?
Answers: 1
question
Computers and Technology, 24.06.2019 13:30
Which type of excel chart should be used to track students’ progress on test grades? line column bar pie
Answers: 2
question
Computers and Technology, 24.06.2019 17:50
Which of the following best describe how the depth-limited search works. a normal depth-first search is performed but the number of ply/depths is limited. a normal breadth-first search is performed but the number of ply/depths is limited. a normal breadth-first search is performed but values above a specific value will be ignored. a normal depth-first search is performed but values above a specific value will be ignored.
Answers: 1
You know the right answer?
The value of π can be approximated by using the following series: the following program uses this s...
Questions
question
History, 05.07.2019 02:30