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
How many of these imformation have you shared​
Arlecino [84]

Answer:

a info none but a few

Explanation:

we are the ffe

6 0
3 years ago
You are sharing your computer screen to collaborate on a document. Which view should you use to minimize the ribbon and give you
Alinara [238K]

The view that you should use to minimize the ribbon and give your document the most screen space is Read Mode (Windows) or Focus (Mac).

<h3>What is Microsoft read mode?</h3>

Microsoft Office is one that gives a lot of different views for documents, and one of which is read mode.

Note that the Read Mode was set to help remove distractions while reading and working on document.

Therefore, The view that you should use to minimize the ribbon and give your document the most screen space is Read Mode (Windows) or Focus (Mac).

See options below

Read Mode (Windows) or Focus (Mac)

Draft view

Web Layout view

Outline view

Learn more about computer from

brainly.com/question/24540334

#SPJ1

5 0
2 years ago
Kenny has gone to a rocky beach to take a photo of the sunset. He wants to level his shot perfectly. He is aware that his tripod
iragen [17]

Answer:

it would probably be on the right side

Explanation:

3 0
4 years ago
Read 2 more answers
6. Which of the following items is not a storage
stealth61 [152]

Answer:

Plotters

Explanation:

A 'plotter' is an external hardware device like a printer used with a computer to 'print vector graphics' - basically in english it no hold storage like that

5 0
3 years ago
Can you anyone please help me​
Yuliya22 [10]

Answer:

Option C I think

3 0
3 years ago
Other questions:
  • Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both doubles) as input, and output the g
    12·2 answers
  • You have configured your organization's dhcp server to dynamically assign ip addresses to ghcp clients using a lease duration of
    5·1 answer
  • Before you start creating a database, you should first use paper to plan, test, and revise. True False
    7·2 answers
  • Given an int variable n that has already been declared and initialized to a positive value, and another int variable j that has
    9·1 answer
  • What are the advantages of the java.util.Stack implementation of a stack?
    10·1 answer
  • The time delay of a long-distance call can be determined by multiplying a small fixed constant by the number of communication li
    8·1 answer
  • You are in charge of five software development projects. The ‘characteristics’ of each of your projects are as follows:
    6·1 answer
  • Case Project 9-4: Troubleshoot an IP configurationYou work at a help desk and have just received a call from an employee who say
    11·1 answer
  • Please i need your help
    12·1 answer
  • All character entities end with _____ to signal the browser that everything in between is an entity representing a symbol.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!