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.
Answer:
It's a compact way of doing an if-else statement.
General Format is
<<em>condition</em>> ? <if condition is true> : <else>;
Example:
I could rewrite:
if(a==1) temp = 1;
else temp = 999;
as
temp = (a==1) ? 1 : 999;
no they used standard 8088 Intel processors
hope this helps
A Data series is a special row in an Excel table that provides a selection of aggregate functions useful for working with numerical data.
Data series
<u>Explanation:</u>
As MS-excel worksheet is used to huge or series of calculation. Through MS-excel people use for calculation and do series of analysis and do graph output.
Even in software development reports are generated and export to MS-excel and further analysis, calculation are made.
MS-excel is wonderful tools is used in computer technology. in MS-excel has many inbuilt function where can be used with single cell or range of cells.
In MS-excel aggregate function such as sum, count, max or min is inbuilt function readily available to user it.
Answer:
short_names = ['Gus', 'Bob','Zoe']
Explanation:
A list is a type of data structure in python that allows us to store variables of different types. Each item in a list has an index value which must be a integer value, and the items can be assessed by stating the index position. The syntax for creating and initializing a list is:
list_name = [item1, item2,item3]
- The name of the list (must follow variable naming rules)
- a pair of square brackets
- items in the list separated by commas.
The python code below shows the implementation of the solution of the problem in the question:
<em>short_names = ['Gus', 'Bob','Zoe']</em>
<em>print(short_names[0])</em>
<em>print(short_names[1])</em>
<em>print(short_names[2])</em>
The output is:
<em>Gus</em>
<em>Bob</em>
<em>Zoe</em>