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
Answer:
Netiquette is a combination of the words network and etiquette and is defined as a set of rules for acceptable online behavior. Similarly, online ethics focuses on the acceptable use of online resources in an online social environment.
- Be Careful With Your Tone.
- Be Accurate and Factual.
- Search First, Then Ask.
- Don't Use Sarcasm Freely.
- Be as Polite as You Are In Person.
Goto settings>display>resolution what os is your system? this was for a win 10
0
1
2
3
4
Those are the outputs
Answer:
Answered below
Explanation:
public class CountVowels{
public static void main (String[] args){
Scanner in = new Scanner(System.in);
String words = in.nextline();
String vowels = "aeiouAEIOU";
int count = 0;
for( int i =0; I< words.length-1; I++){
for( int j = 0; j < vowels.length - 1; j++){
if(words [I] == vowels[j]){
count++;
}
}
}
System.out.print(count);
}
}