Answer:
Including a input statement
Explanation:
You need a input statement in order for it to work, here´s an example;
script.parent.click <u>then</u>
you need the ¨.mouse¨ after parent or it wouldnt work.
Well if you add it up , if one cup of coffe is $1, then in one year it would be $365 on coffe.
Answers:
What is the index of the last element in the array? stArr1.length()-1
This prints the names in order. How would I print every other value? Change line 4 to: index = index +2
Change line 7 to: i < names.length
Answer:
// here is code in c++ to find the approx value of "e".
#include <bits/stdc++.h>
using namespace std;
// function to find factorial of a number
double fact(int n){
double f =1.0;
// if n=0 then return 1
if(n==0)
return 1;
for(int a=1;a<=n;++a)
f = f *a;
// return the factorial of number
return f;
}
// driver function
int main()
{
// variable
int n;
double sum=0;
cout<<"enter n:";
// read the value of n
cin>>n;
// Calculate the sum of the series
for (int x = 0; x <= n; x++)
{
sum += 1.0/fact(x);
}
// print the approx value of "e"
cout<<"Approx Value of e is: "<<sum<<endl;
return 0;
}
Explanation:
Read the value of "n" from user. Declare and initialize variable "sum" to store the sum of series.Create a function to Calculate the factorial of a given number. Calculate the sum of all the term of the series 1+1/1!+1/2!.....+1/n!.This will be the approx value of "e".
Output:
enter n:12
Approx Value of e is: 2.71828