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
dedylja [7]
3 years ago
7

Write a program that prompts the user to input a positive integer. It should then output a message indicating whether the number

is a prime number. (Note: An even number is prime if it is 2. An odd integer is prime if it is not divisible by any odd integer less than or equal to the square root of the number.)
Computers and Technology
1 answer:
mafiozo [28]3 years ago
8 0

// Writing a c++ program

// Making a variable to take input

int input=0;

cout<<"Enter the number ";

cin>>input;

// checking if the entered number is positive and not 0

if(input>0){

// if the mode of number with 2 is 0 then it is Even

 if(input%2==0)

      cout<<"The number is prime.";

// if mode is 1 then its ODD

 else if(input%2==1)

        cout<<"The number is ODD.";

}

You might be interested in
Hello Everyone.<br>I am new here can anyone help me<br>​
sergejj [24]

Welcome to Brainly!

I am just an Expert user (I was originally gonna be a co-mod, but decided not to take the role) who wants to help! On this website/app, you can ask/answer questions! If you ever need help, this website is the place to go! Just make sure you don't break the guidelines and as Sniper would say, "Be polite"

6 0
3 years ago
Read 2 more answers
Create a Python script that enables a user to enter an integer number into the Python console and stores such integer number int
DIA [1.3K]

Answer:

Here is the Python program:

input1 = int(input("Enter an integer: ")) #prompts user to enter an integer

if(input1<0): #if input value is negative

    print("Input1 integer is negative")

elif(input1==0): #if input value is 0

    print("Input 1 integer is zero")

elif(input1<=30): #if input value is less than or equal to 30

    print("Input 1 is positive but less or equal than 30")

else: #if input value is greater than 30

    print("Input 1 is positive and greater than 30")    

Explanation:

I will explain the program with an example

Lets say user enters 16 as input So

input1 = 60

Now the first if condition if(input1<0): is false because 60 is not less than 0

The second elif (else if) condition elif(input1==0): also evaluates to false because 60 is not equals to 0

The third elif condition elif(input1<=30): evaluates to false because the input value is 60 which is not less than or equal to 30.

The fourth else part executes because all the above if elif conditions evaluate to false which means the input number if neither negative, nor 0 and not less than or equal to 30. Hence the input number is greater than 30 and this is true as 60 is greater than 60. So the print statement executes which is:

    print("Input 1 is positive and greater than 30")

The message in the above print statement is printed on the output screen.

The screenshot of the program along with its output is attached.

6 0
3 years ago
All of the following are basic functionality provided by e-commerce merchant server software except: Question 22 options: A) pro
UNO [17]

Answer:

The correct answer is option A "productivity software"

Explanation:

An e-commerce merchant server software is a software that enables sales exclusively over the Internet. It is a software that connects to a company server with the aim of allowing sales of the company's products to take place over the internet. Here, sales are capped with customers even paying for what they purchase online.

A product catalog in an e-commerce merchant server software shows lists of essential products that buyers can purchase online. These lists include product features, price, color, brand, size, and so many other examples.

A shopping cart is some sort of functionality in eCommerce software used to collect the items potential buyers select online with the aim to make it easier for the buyers to see all the items selected after shopping, make necessary adjustments if need be before payment.

Credit Card processing allows e-commerce merchant server software make buyers get card payment options to get their payment processed. In the authorization stage, the merchant must obtain approval for payment from the issuing bank. Some banks would require their client to activate this payment option with them at the bank before such clients are allowed to do e-commerce payments.  

The correct answer is productivity software because it is a software used for producing information that shows the productivity of a particular group, persons. In other words, productivity software can help produce things that simplify productivity they include worksheets, graphs, digital videos, and so many other examples.

4 0
4 years ago
Can ps3 games be played on ps4 game system
worty [1.4K]
I'm kind of an expert on Video games, since I play them myself~ ;) But now on to answering your question, the answer is.... No.. You can<span>'t </span>play<span> your old </span>PS3 games<span> on </span>PS4<span>, even by inserting the disc or downloading them again from PSN, it shall not work. </span>
5 0
4 years ago
Read 2 more answers
The importance of optimizing a code
Tanya [424]

Answer:

Definition and Properties. Code optimization is any method of code modification to improve code quality and efficiency. A program may be optimized so that it becomes a smaller size, consumes less memory, executes more rapidly, or performs fewer input/output operations.

7 0
3 years ago
Other questions:
  • Write a function so that the main() code below can be replaced by the simpler code that calls function MphAndMinutesToMiles(). O
    5·1 answer
  • A bitmap picture can be represented by hexadecimal numbers. Each two-digit hexadecimal number represents a row. To convert a num
    14·1 answer
  • Which term describes a process by which malicious code can enter from a non-secure network, and make a hairpin, or sharp turn, a
    6·1 answer
  • The Go To feature can be accessed from which of the following dialog boxes?
    10·1 answer
  • Within an organization, a(n) ____ is a group of individuals who are united by shared interests or values and who have a common g
    10·1 answer
  • A cost-benefit analysis is intended to increase the likelihood that a support analyst has considered the major advantages and di
    5·1 answer
  • From an audio standpoint, how would a city street rate as a possible film location? great because city streets are interesting t
    15·1 answer
  • Https://www.blooket.com/play?id=300932<br> please
    8·2 answers
  • True/False: A datasum can be generated for any width of data. For example, we can create an 8, 16, or 32 bit datasum for 8, 16,
    14·1 answer
  • Determine which system you would recommend each of the customers use based on their provided user and system specs.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!