The answers are too long. I have compiled them in Word and attached them below.
Answer:
#include <iostream>
#include<cmath>
using namespace std;
int main()
{
double total = 0;
double check=1;
double ct=0;
double old=1;
while( fabs(total - old) > 0.00005 )
{
old=total;
total=total+check*4.0/(2.0*ct+1);
ct=ct+1;
check=0.0-check;
}
cout<<"Approximate value of pi is "<<total<<endl;
return 0;
}
Explanation:
- Initialize all the necessary variables.
- Run a while loop until the following condition is met.
fabs(total - old) > 0.00005
- Inside the while loop calculate the total value.
- Lastly, display the approximate value of pi.
The standard IP convention used in today's network is IPv4. Taking for example one basic IP address we have 192.168.1.1 - The ff IP has 4 octets. An octet is a group of 8 bits on the sample, we have 4 Octets making up 32 a standard 32 bit address.