Question
please can anyone help me and explain this assignment for me. write program that contains two parts. this program should be written in C. Part
please can anyone help me and explain this assignment for me.
write program that contains two parts. this program should be written in C.
Part 1
Approximate PI to 10 places with the following formulas from using integer division and modulus operators
22/7
25/8
256/81
339/108
These are each stored in an array of size 10, each digit in a separate element. For instance, 3.1415926535 would be stored
3 | 1 | 4 | 1 | 5 | 9 | 2 | 6 | 5 | 4 |
void CalculatePi(int myPI[], int size, int numerator, int denominator);
Part 2
Print each array with a * below the location the value first differs from the above value of PI
For instance:
3.139123456 would print out
3 | 1 | 3 | 9 | 1 | 2 | 3 | 4 | 5 | 6 |
* |
void PrintArray(int myPI[], int goodPI[], int size);
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started