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
Perform online or offline research to learn more about film elements. Then, write a short report on the essentials of filmmaking
pshichka [43]

Answer:

Screenplay

Financing

Theme

cinematography

editing

sound and music

Acting and Genre

Explanation:

There are various essential elements that needs to be considered to become a famous and a good filmmaker. A good filmmaker will take care of small elements and will consider minor details. The audience is very keen when it takes interest in the movie. They pay attention to even minor details in the movie. The filmmaker should take care of all the details and will have to decide on the main things such as screenplay, audio, editing, genre of the movie and similar. These elements are dependent on each other. If the audio of the movie is not appropriate or sound quality is not suitable then the overall impact of the movie will be slowed no matter how strong the content is. There is high dependency of all the elements and every element should be paid attention.

3 0
2 years ago
What is output by the following?<br><br>print (type("95"))
statuscvo [17]

Answer:

The output is "<class 'str'> ".

Explanation:

In the given python code a print() function is defined. Inside this function, a type() function will use, in which a numeric value is passed in the double quotes (" ") as a function parameter. Double quotes are normally used for print value as a message but in this code, value is not printed because we use the type() function.

  • The type() function Returns the parameter class type of the argument(object).
  • This function is used for debugging. In this function, we pass a single parameter that will return the type of given object.
6 0
3 years ago
Insert a row above the selected row
anastassius [24]
I cants see the "Selected Road" And I cant answer this unless you put that up. Sorry.
6 0
3 years ago
Read 2 more answers
Which activity uses a feature of a word processor?
Anvisha [2.4K]
The activity that uses a feature of a word processor is the last given answer. Recreating the same document multiple times to print multiple copies. Although some word processors have all the features stated above now a days. Word processors are helpful in composing, editing and printing text documents.
3 0
3 years ago
Read 2 more answers
Order the steps for accessing the junk email options in outlook 2016
Zinaida [17]

Answer:

What is the question here? lol

Explanation:

8 0
3 years ago
Other questions:
  • _____ refer(s) to computer programs that provide instructions for a computer to execute a desired task. Answer .a.Software .b. I
    7·1 answer
  • Which of the following is needed if a computer with the IP address 172.31.210.10/24 wants to communicate with a computer with th
    5·1 answer
  • A bin contains 100 sty le a notebooks, 100 style b notebooks, and 100 style c notebooks. antoine will select 3 notebooks from th
    9·1 answer
  • What was a result of george washington's belief in the sovereignty of the people instead of monarchy?
    9·1 answer
  • Which is not a factor that leads to technological advancement?
    8·1 answer
  • A microsoft windows os component responsible for representing graphical objects and transmitting them to output devices such as
    15·1 answer
  • I’m gonna ask this again because I REALLY need an answer.
    10·2 answers
  • Give an idea of a law u would like to create
    5·2 answers
  • Alguien porfavor me dice como cambiar de idioma en brainly
    15·1 answer
  • PLEASE HELP!
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!