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
inn [45]
4 years ago
8

Use the isprime function that you wrote in programming challenge 21 in a program that reads in an integer that is less than 3001

stores a list of all the prime numbers from 2 through that number in a file name d "primelist.txt". prompts and output labels. no prompts, no labels. after closing the file, the program writes "prime numbers written to primelist.txt." on a line by itself in standard output . input validation if the value read in exceeds 3000, the program silently terminates. // function prototype bool isprime(int);
Computers and Technology
1 answer:
Andrews [41]4 years ago
8 0
Just include all the following data accurately. 
#include <iostream>
#include <fstream>
using namespace std;

bool isPrime(int);

int main()
{
int num=0;
int i;
bool prime;

ofstream outFile;
outFile.open("PrimeList.txt");

while (num == 0 )
{
cin >> num;
}

for(i=2;i<num;i++)
if(isPrime(i))
outFile << i << "\n";

cout << "Prime numbers written to PrimeList.txt.
\n";
outFile.close();
return 0;
}
bool isPrime(int n)
{
int i;
for(i=2;i<n-1;i++)
if(n%i==0)
 return false;
return true; 
}
You might be interested in
Using reliable internet sources, identify three ways we use analog and digital signals in our everyday lives.
Montano1993 [528]
Clocks maybe is the answer. I really don’t know
7 0
3 years ago
Write the code to call a CSS file named "exam.css".
katen-ka-za [31]

Answer:

 <link rel="stylesheet" href="exam.css">

Explanation:

href is the file name assuming its in the same path

also get an extension called grepper, it helps debug a lot quicker

7 0
2 years ago
Read 2 more answers
What's the difference between a Boolean function and a Boolean expression?
Vikki [24]

Explanation:

A boolean function is a function in any programming language whose return type is boolean means a function that returns true or false.For ex:-

bool func(int a,int b)

{

     if(a>b)

return true;

else

return false;

}

An expression is a combination of one or more variables,constants,operators,function and which is computed and produces a value in case of boolean expression the value that is calculated is either true or false.

for ex:-     bool result= a>b  && a>c;

7 0
4 years ago
PLEASE HELP 15 POINTS; JAVASCRIPT
sdas [7]

Answer:

D

Explanation:

4 0
3 years ago
Explain word count <br>in ms word Processing​
Mamont248 [21]

Answer:

A word count is a numerical count of how many words a document contains.

Explanation:

Most word processors today can count how many words are in a document for the user.

When you type in a document, Word automatically counts the number of pages and words in your document  and displays them on the status bar at the bottom of the workspace.

Word also counts pages, paragraphs, lines, and characters.

3 0
3 years ago
Other questions:
  • Who will win the premier league
    9·2 answers
  • hey computor guys. is the MSI B250M GAMING PRO LGA 1151 Intel B250 HDMI SATA 6Gb/s USB 3.1 Micro ATX Motherboards - Intel compat
    8·1 answer
  • A ____________ is a set of commands which can be run by calling it by name. (Phyton)
    7·2 answers
  • ​Which of the following styles sets the column breaks within paragraphs to leave a minimum of two and three lines at the top and
    11·1 answer
  • 1. We want to add a button to the tally counter in Section 9.2 that allows an operator to undo an accidental button click. Provi
    8·1 answer
  • How do I do these? I dont understand.
    12·1 answer
  • he wants to customize the operating system to meet his needs. what types of tools should he use, and what can he do with each?
    6·1 answer
  • Who is your favorite<br><br> A. Jacksepticeye<br><br> B. SSSniperwolf<br><br> C. Markiplier
    11·2 answers
  • Which of the following is/are used in multimedia?
    14·1 answer
  • In a certificate authority (ca) infrastructure, why is a client certificate used?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!