Answer:
// here is code in C++.
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// variables
int n;
double average,sum=0,x;
cout<<"enter the Value of N:";
// read the value of N
cin>>n;
cout<<"enter "<<n<<" Numbers:";
// read n Numbers
for(int a=0;a<n;a++)
{
cin>>x;
// calculate total sum of all numbers
sum=sum+x;
}
// calculate average
average=sum/n;
// print average
cout<<"average of "<<n<<" Numbers is: "<<average<<endl;
return 0;
}
Explanation:
Read the total number from user i.e "n".Then read "n" numbers from user with for loop and sum them all.Find there average by dividing the sum with n.And print the average.
Output:
enter the Value of N:5
enter 5 Numbers:20.5 19.7 21.3 18.6 22.1
average of 5 Numbers is: 20.44
Answer:
1000
Explanation I SEARCHED IT Up
Answer:
48
Explanation:
In this code, there is a method i.e "product" of "int" type it means it returns the integer value. The description of the given code is given below
- Initially when product(6) function is called the else block will be executed so return(6)*product(4).
- As we saw that above product(4) is a recursion function " Function which calls itself again and again " . so again else block is executed now the value is return(6)*return(4) *return(2);
So it returns 48
Answer:
i think the answer is point C