1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Finger [1]
1 year ago
14

Write a program in C++ to Find the Average of the sum of prime numbers between 1 to any given number

Computers and Technology
1 answer:
mixas84 [53]1 year ago
8 0

Using the knowledge in computational language in C++ it is possible to write a code that Find the Average of the sum of prime numbers between 1 to any given number

<h3>Writting in C++ code:</h3>

<em />

<em>#include <iostream></em>

<em>using namespace std;</em>

<em>bool isPrime(int n){</em>

<em>   for(int i = 2; i < n/2; i++){</em>

<em>      if(n%i == 0){</em>

<em>         return false;</em>

<em>      }</em>

<em>   }</em>

<em>   return true;</em>

<em>}</em>

<em>int findPrimeSum(int n){</em>

<em>   int sumVal = 0;</em>

<em>   for(float i = 2; i <= n; i++){</em>

<em>      if(isPrime(i))</em>

<em>         sumVal += i;</em>

<em>   }</em>

<em>   return sumVal;</em>

<em>}</em>

<em>int main(){</em>

<em>   int n = 15;</em>

<em>   cout<<"The sum of prime number between 1 to "<<n<<" is "<<findPrimeSum(n);</em>

<em>   return 0;</em>

<em>}</em>

See more about C++ code at brainly.com/question/19705654

#SPJ1

You might be interested in
안녕 또 나야 난 너에게 미래의 메시지를 전하러 왔어 01100011 01101111 01101101 01101111 00100000 01111001 00100000 01101100 01101111 00100000 01101101
sashaice [31]

Answer:

i think its 01100001

Explanation:

4 0
3 years ago
Read 2 more answers
The material to be broadcast and the way it's arranged is called __________. (10 letters)
ladessa [460]

Answer:

journalism

Explanation:

7 0
3 years ago
Which of the follow is an example of an integer?<br> "1.091"<br> "number"<br> 15<br> name
UkoKoshka [18]

Answer:

The answer is 15

Explanation:

A integer is a whole number, the only wholenumber present is 15

Hope this helps :)

8 0
2 years ago
_ is the use of a collection of computers, often owned by many people or different organizations, to work in a coordinated manne
ddd [48]

Answer:

"Grid computing" is the correct answer for the above question.

Explanation:

  • Grid computing is a process in which many computers are participating to solve a single problem. This type of process is distributed multiple computers to perform a different type of task.
  • If there is large problem and if many computers solve that problem, then that problem is solved easily within a few minutes.
  • This is because many computers are working for that problem.
  • The above question asked about that process in which many computers are working to solve a single problem. This processor is known as "Grid Computing".
8 0
3 years ago
The ub-04 form would most likely be used in what setting?
wlad13 [49]

The UB-04 form would most likely be used in the following setting:

  • Hospitals
  • Hospices
  • General health centers such as rural clinics.
  • Rehab facilities

The uniform bill (UB-04) form is also referred to as CMS-1450 and it is a standard claim form that is used for billing and submitting Medicare Part A outpatient or inpatient health claims to Medicare fiscal intermediaries such as insurance companies, medical providers (hospitals), etc.

Also, the uniform bill (UB-04) form was introduced by the National Uniform Billing Committee (NUBC) in 2004, so as to replace the UB-92 form.

Generally, UB-92 form is a paper claim form that is typically used for laboratory, radiology, surgery, etc. Thus, the UB-04 form would most likely be used in the following setting:

  • Hospitals
  • Hospices
  • General health centers such as rural clinics.
  • Rehab facilities

Read more on UB-04 form here: brainly.com/question/4437165

4 0
2 years ago
Other questions:
  • Analyze the following code. II: public class Test { public static void main(String[] args) { System.out.println("Welcome to Java
    11·1 answer
  • The person or persons requesting the worksheet should supply their requirements in a _____ document
    6·1 answer
  • Explain the role of the domain name system
    15·1 answer
  • Which is a copyright
    5·1 answer
  • What does snap do need the answer now
    10·2 answers
  • What does the Additional Clock tab do?
    11·1 answer
  • Linux is: Select one: a. primarily concerned with the tasks of end users. b. designed for specific machines and specific micropr
    10·1 answer
  • You can use the Ignore All button to ignore the current and all future occurrences of a flagged word. True or False
    5·1 answer
  • An example of an asset is:<br><br> A. Time<br> B. Money<br> C. A Car <br> D. All of the above
    5·2 answers
  • PYTHON:Given the dictionary, d, find the largest key in the dictionary and associate the corresponding value with the variable v
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!