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
olya-2409 [2.1K]
3 years ago
14

g Design a Boolean function called isPrime, that accepts an integer as an argument and returns True if the argument is a prime n

umber, or False otherwise. Use the function in a program that prompts the user to enter a number and then displays a message indicating whether the number is prime. The following modules should be written
Computers and Technology
1 answer:
professor190 [17]3 years ago
4 0

Answer:

#include <bits/stdc++.h>

using namespace std;

bool isPrime(int n)

{

   for(int j=2;j<=n-1;j++)  //loop to check prime..

   {

       if(n%j==0)

       return false;

   }

   return true;

}

int main(){

   int n;

   cout<<"Enter the integer"<<endl;//taking input..

   cin>>n;

   if(isPrime(n))//printing the message.

   {

       cout<<"The number you have entered is prime"<<endl;

   }

   else

   {

       cout<<"The number is not prime"<<endl;

   }

return 0;

}

Output:-

Enter the integer

13

The number you have entered is prime

Explanation:

The above written program is in C++.I have created a function called isPrime with an argument n.I have used a for loop to check if the number is prime or not.In the main function I have called the function isPrime for checking the number is prime or not.

You might be interested in
¿Es aquel panel que controla la estructura de la tabla dinámica?
blondinia [14]

Answer:

PARTES DE UNA TABLA DINÁMICA

Una vez que has aprendido cómo crear una tabla dinámica en Excel es conveniente detenerse un momento para conocer las partes que la componen y comprender el funcionamiento de cada una de ellas.

PARTES DE UNA TABLA DINÁMICA EN EXCEL

Justo cuando se ha creado una tabla dinámica se muestra en la parte derecha de la hoja la lista de campos disponibles y por debajo las áreas donde podemos arrastrar dichos campos. Estas áreas denotan cada una de las partes de una tabla dinámica.

Explanation:

hope it helps you

8 0
2 years ago
Read 2 more answers
You can use predesigned, formatted files called _____ to create new worksheets quickly.
Leokris [45]
You can use predesigned, formatted files called -templates- to create new worksheets quickly.
8 0
3 years ago
True or False
anastassius [24]

I used this from a other.

False

Software is the collection of large program or instruction of codes, which is used to perform some task. It is of two types of system software and application software.

The system software is used as a container for the application software and it is used to handle all other software it is used to operate the system.

Application software is used to perform any operation. This type of software can be used by the user if it is installed on the local machine on any system software

The operating system is also the part of the system software because it is used to operate the system and it is also the soul of the computer system which is also the function of the system software but the above question states that the operating system is not the part of the system software which is not correct. Hence false is the correct answer to the above question.

5 0
3 years ago
Which of the following is opened when the Find command is clicked? Question 9 options: Navigation Pane Insert Hyperlink dialog b
Dima020 [189]

The element, from the following options, which is opened when the find command is clicked is the search pane.

What is find command?

Find command is the command which is used to find the list of files and their location.

Find command can be used in different manners-

  • To find the different files in a system.
  • Find command can find the files by their name, size, date or other information related to the required document.
  • This command can be modified with the requirement of the search.

The options for the given problem are-

  • Navigation Pane Insert- It is used to show the navigation pane in word or similar space.
  • Hyperlink dialog box-This open, when the insert hyperlink command is clicked.
  • Bookmark dialog box-This opens, when the bookmark command is clicked.
  • Search Pane- Search pane is opens, when the find commond is clicked.

Thus, the element, from the following options, which is opened when the find command is clicked is the search pane.

Learn more about the find command here:

brainly.com/question/25243683

4 0
2 years ago
Many commercial encryption programs use a technology called ____, which is designed to recover encrypted data if users forget th
never [62]

Answer: key escrow

Explanation:

Using key escrow we are able to recover data if passphrase is forgotten. this technique uses a bypass link to get all the keys to the system only if it is an authorized entry.

7 0
3 years ago
Other questions:
  • Ryan is looking at investment opportunities as a cloud service provider. He wants to invest in a deployment-based cloud model th
    11·2 answers
  • Describe the Software Development Life Cycle. Describe for each phase of the SDLC how it can be used to create software for an E
    14·1 answer
  • If you have a charger that’s not from Apple, then could that damaged your iPhone or not?
    5·1 answer
  • Your employer is opening a new location, and the IT director has assigned you the task of calculating the subnet numbers for the
    14·1 answer
  • Do you need internet to play xbox one
    14·1 answer
  • What is the hexadecimal equivalent of the decimal number 256?
    11·1 answer
  • Doctors at a regional hospital access an online database of patient records that is being developed and tested by a conglomerate
    13·1 answer
  • the front desk of the Nocete's Hotel will comlute the total room sales (TRS) of Room 101.The room was occupied three times and t
    6·1 answer
  • What is string literal in Java?
    5·1 answer
  • B. WAP to check whether input number is palindrome number or not using SUB...... END SUB.​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!