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
What is software?
bogdanovich [222]

Answer:

B

Explanation:

3 0
3 years ago
Read 2 more answers
ICT4AD was meant to modernize the civil service through E-governance implementation.
astra-53 [7]

ICT4AD work through E-governance implementation fail as a result of:

  • Lack of Infrastructure.
  • High cost of running its affairs as it needs  huge public expenditure.
  • Issues with Privacy and Security and others.

<h3>What is the aim of e-governance?</h3>

The objectives of e-Governance is created so as to lower the level of corruption in the government and to make sure of  fast administration of services and information.

Conclusively, It is known to fail due to the reasons given above and if they are worked on, the service would have prospered.

Learn more about civil service from

brainly.com/question/605499

7 0
1 year ago
Describe three ways to call attention to the text on a web page.
vichka [17]

Answer:

Underline the important text.

Make Links a Different Colour.

Making visual adjustments such as making text bold, making it italicized, making it ALL CAPS.

8 0
3 years ago
Now that you’ve learned how to make a basic webpage using HTML and CSS, you’re going to get creative with your skills! For this
bearhunter [10]

Answer:

im trying to figure this out i will tell you when i am finished

Explanation:

I will edit it when im done

4 0
2 years ago
The _____________________ is the measure of how servers are condensed as a result of virtualization.
hodyreva [135]

Answer:

Consolidation ratio

Explanation:

Consolidation ratio within network infrastructure for Internet hosting, is the number of virtual servers that can run on each physical host machine.

5 0
2 years ago
Other questions:
  • Write a loop that sets newScores to oldScores shifted once left, with element 0 copied to the end. Ex: If oldScores = {10, 20, 3
    15·1 answer
  • Travis sends Suri what purports to be a link to an e-birthday card, but when she clicks on the link, software is downloaded to h
    11·1 answer
  • Jenny is the project manager and her company. She needs to break her current project into parts that her employees can work on.
    10·1 answer
  • Which of the following is your personal record of payments and bill-paying?
    13·1 answer
  • Describe the dynamic Network Address Translation (NAT).
    9·1 answer
  • Using the program below, explain what the output will be at LINE A. 1 #include 2#include 3#include 4 5 int value - 128; 6 7 int
    11·1 answer
  • Where is the start frame delimiter found in the Ethernet frame
    9·1 answer
  • In science class, Patricia is giving a presentation on the different types of flowers in her community. As part of her presentat
    5·1 answer
  • What creative commons license allow for the work to be copied, distributed, displayed, or performed but modifications may not be
    13·1 answer
  • You are planning to write a guessing game program where the user will guess an integer between one and 20. Put the commented ste
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!