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
Salsk061 [2.6K]
3 years ago
6

Your program will search for prime numbers. You will first ask the user for the range of values to search, and use for loops to

progress through all the numbers chosen. Note to determine if a number is a prime number, you must check to find out if there are any values besides 1 and itself that divide into it evenly. If any other numbers found then it is not prime. To check if any number is divisible, use the modulus operator which gives the value of the remainder of a division. List off all prime numbers found within a range given by the user. Do not list off numbers that are not prime. Also output at bottom the total number of primes from. See sample output at bottom of project sheet. Hint: first write the code that will determine if a given single number is prime or not, then put it in a larger loop. write in java.
Computers and Technology
1 answer:
Stells [14]3 years ago
7 0

Answer:

Java code is given below

Explanation:

import java.util.Scanner;

public class Prime {

public static void main(String args[]) {

int first, last, flag = 0, i, j;

Scanner s = new Scanner(System.in);

System.out.println("Enter the lower limit :");

first = s.nextInt();

System.out.println("Enter the upper limit :");

last = s.nextInt();

System.out.println("The prime numbers in between the entered limits are :");

int x = 0;

for (i = first; i <= last; i++) {

for (j = 2; j < i; j++) {

if (i % j == 0) {

flag = 0;

break;

} else {

flag = 1;

}

}

if (flag == 1) {

x++;

System.out.println(i + " ");

}

}

System.out.println("Total number of prime numbes between " + first + " and " + last + " are " + x);

}

}

You might be interested in
What's the value of this Python expression? ((10 &gt;= 5*2) and (10 &lt;= 5*2))
elena-14-01-66 [18.8K]

Answer:

The Boolean value returned by that expression will be True

Explanation:

We have two logical statements in that expression:

Expression 1: (10 >= 5*2)

This can be read as: is 10 greater than or equal to 5 multipled by 2. This evaluates to true as 10 is equal to 5 * 2. Hence expression 1 returns true

Expression 2: (10 <= 5*2)

This can be read as: is 10 less than or equal to 5 multiplied by 2. This also evaluates to true as 10 is equal to 5*2. Hence expression 2 returns true.

Now between this two expression is the and operator which evaluates to true if and only if both logical expressions returnes true.

True and True ==> True

Since Expression 1 ==> True and Expression 2 ==> True

This means Expression 1 and Expression 2 ==> True which is the Boolean value returned by the statement

5 0
3 years ago
what is the system that connects application repositories, systems, and it environments in a way that allows access and exchange
geniusboy [140]

The system that connects application repositories, systems, and it environments in a way that allows access and exchange of data over a network by multiple devices and locations is called Cloud integration.

<h3>What is the role of a cloud integrator?</h3>

Cloud-based integration is a type of systems integration business that focuses on data, process, service-oriented architecture, and application integration. It is offered as a cloud computing service.

Therefore, An integrator of the cloud offers services to help organizations integrate their software programs. Data conversion, process design, architecture, and application setup fall under this category.

Learn more about Cloud from

brainly.com/question/9759640
#SPJ1

5 0
1 year ago
What are the uses of DVD Ram​
Verdich [7]

Answer:

Like ordinary random access memory (RAM), it can be repeatedly read, written to, and erased. Intended mostly for removable computer storage, DVD-RAM provides the capabilities of Rewriteable CD (CD-RW) - users can run programs from the discs, copy files to them and rewrite or delete them.

4 0
3 years ago
Read 2 more answers
How did the development of silicon chips impact computer usage?
AlekseyPX

D. Silicon made miniaturization possible.

5 0
4 years ago
Read 2 more answers
Discus four importance of applications software​
AlladinOne [14]

Answer:

l hope this helps Good luck.

6 0
4 years ago
Other questions:
  • What is the transfer rate of DDR memory?<br> A. 16 bit <br> B. 32 bit <br> C. 64 bit <br> D. 128 bit
    11·2 answers
  • What do you think about the argument that word processing reduces the quality of writing?
    11·1 answer
  • In object-oriented development, why is it necessary to use drivers and stubs in testing?
    9·1 answer
  • Which would increase electric current? increasing the resistance increasing the size of the wire decreasing the voltage
    6·1 answer
  • Define a method printFeetInchShort, with int parameters numFeet and numInches, that prints using ' and " shorthand. End with a n
    7·2 answers
  • What are five features of word 2016 you would use to make a brochure
    6·2 answers
  • Nilsu is attempting to train a new administrative assistant on using a word processing program. Since the program is fairly comp
    15·1 answer
  • Power point is hardware or software​
    12·2 answers
  • What are some recent inventions that have improved the quality of your life?
    10·1 answer
  • In order to access the internet, it is not necessary to have an Internet Service Provider (ISP).
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!