/ This program will calculate the prime numbers from 1 to 1000.
#include <iostream>
using namespace std;
int main()
{
double first; // To hold the first input
double second; // To hold the second input
//Get the input from the user
cout << "Enter a whole number between 1 and 1000" << endl;
cin >> first >> endl;
cout << "Enter a second whole number between 1 and 1000" << endl;
cin >> second >> endl;
//Calculate the entered data
if (first / 2)
cout << first << "is a prime number" << endl;
else
cout << first << "is not a prime number" << endl;
if (second / 2)
cout << second << "is a prime number" << endl;
else
cout << second << "is not a prime number" << endl;
c++. pico editor. I just need it to compile. Why isn't it working. I need it to say this;
Enter a number between 1 and 1000
*get that number and store it in 'first'
then i need it tosay
enter a second number between 1 and 1000
*get number and store it in 'second'
then I need a if statement that says
if the number they put in (first or second)
is divisible by 2 then shoot back the number they put in to them and let them know if it is prime or not.