Program to determines and print all prime numbers

Assignment Help Programming Languages
Reference no: EM1370581

An integer is said to be prime if it is divisible by only 1 and itself. For example, 2, 3, 5 and 7 are prime, but 4, 6, 8 and 9 are not.

a. Write a function that determines whether a number is prime

b. Use this function in a program that determines and prints all the prime numbers between 2 and 10,000. How many of these numbers do you really have to test before being sure that you have found all the primes?

Reference no: EM1370581

Questions Cloud

Diminishing marginal productivity : Marginal productivity can be divided into three ranges: Increasing marginal productivity; Diminishing marginal productivity; and Negative marginal productivity.
Should administration be fair to all institute : Should the decision-making process be top-down (centralized with top administrators) or bottom-up and how should issues such as protect-your-turf mentality, resistance to change, and consensus building be dealt with?
Explain what are the key issues facing saxonville sausage : Explain What are the key issues facing Saxonville Sausage Company when launched national Italian Sausage brand?
Phases of the business cycle : Determine the four phases of the business cycle? How long do business cycles last and how do seasonal variations and long-run trends complicate measurement of businrss cycle?
Program to determines and print all prime numbers : Use this function in program which determines and prints all prime numbers between 2 and 10,000. How many of these numbers do you actually have to test before being sure that you have found all primes?
Explain what aspects of the environment support : Explain What aspects of the environment support this structure and Are there any aspects of the internal or external environment that currently or in the near future push for changes in university structures?
Cutthroat competition, oligopoly and collective bargaining : Describe the cutthroat competitors reasons for not raising or lowering his price, thereby accounting for the kink in his demand curve.
Monopoly-its effect on society : There're many different kinds of monopolies which exist in the market. you're going to talk about the different kind of monopolies, their place in the market, and their effect on society. please describe the following:
Explain prudent policy to protect datafrom corruption-theft : The opposing require to protect this data (from corruption and theft) which typically means controlling access to much/all of the data? What policy is prudent here?

Reviews

Write a Review

Programming Languages Questions & Answers

  How to use bit vector to represent dynamic set of distinct

Explain how to use a bit vector to represent a Dynamic Set of Distinct Elements with no Satellite Data. Dictionary Operations must Run in O (1) Time.

  Program to read information from keyboard

Write a C++ program that reads the following information from the keyboard terminated with the sentinel -999 in the Student Number, and stores the records in arrays (3 separate arrays).

  Class to create and draw five squares

Now write applet DrawSquares that uses your Square class to design and draw 5 squares. This code must be very simple.

  Pseudocode that will generate reports from data files

Develop a mock-up of each of these reports, and get customer approval of these mock-ups. Write pseudo code that will generate these reports from the data files, using a CASE tool;

  Write program compute salary by adding base tax

Compute by adding base tax for that salary range and product of percentage of excess and amount of salary over minimum salary for that range. Write a program which solves this problem.

  Design and write a payroll program

Design and write a payroll program that will prompt the user to enter an employee's hourly pay rate and the number of hours worked.

  Design program to compute-display number of miles per hour

Design a program that calculates and displays the number of miles per hour over the speed limit that a speeding driver was doing.

  Write program for user to perform arithmetic operations

Write a program that lets the user perform arithmetic operations on fractions. Fractions are of the form a/b, where a and b are integers and b is not equal to 0.

  Design program which ask the user for positive interger

Design a program which ask the user which application to do: after choosing from factorial or triangle(magicSquare), the program must then ask again the user for a positive interger.

  Write program to accept name and score of all batsmen

Write a program to accept name and score of all batsmen of a team and print them in the given manner: INPUT:names[]={nam1,nam2,nam3,nam4,nam5,nam6} & scores[]={48,65,73,10,90,84}

  Program to display words in a list box sorted by number

Write a program to display the words in a list box sorted by the number of different vowels(a,e,i,o,u) in the word.

  Threads belonging to same process affected by page fault

Other user user threads belonging to the same process also be affected by the page fault - that is would they also have to wait for the faulting page to be brought into memory? Explain.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd