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
The most useful index fossils are of organisms that are still alive today.
mars1129 [50]
Im going to say that the answer is true but this is a earth science question next time please post in science category!
4 0
3 years ago
Read 2 more answers
A type of Knowledge Management System is called
sveticcg [70]

Answer:

 Knowledge management systems  refer to the use of modern information technologies—the Internet, intranets, extranets, databases—to systematize, enhance, and expedite intra-firm and inter-firm knowledge management.

Explanation:

4 0
4 years ago
How do the following technologies help you with your quest to become a digital citizen kiosks enterprise computing, natural lang
Dafna11 [192]

Answer:

How could be an individual become a digital citizens?

Skills such as self-advocacy, conflict resolution, anger management, and decision-making skills, as well as the ability to use assertiveness, resistance, and refusal techniques, are also included and can help students respond safely and effectively online

Explanation:

SAlamat po pa rate nalang

5 0
2 years ago
True or False: You cannot change the default margin size for Word documents.  
Veronika [31]
The answer is false because you can change the margin size on words documents.
8 0
3 years ago
Topic: Drivers ed 100 points and brainliest!
ddd [48]

Answer: Ill explain it!

Explanation: Modern technology is extremely beneficial to drivers because the modern cars have sensors that detect the range of other cars, when they stop and you might not see or be ready for it, your car will slam the brakes for you, this alone saves many lives. Another is like a Tesla with autopilot. Lets say for example one day your really sleepy or dont feel good, its a stress to keep the car straight. You could turn on autopilot and it could assist you with your driving, and their system has shown to be for the most part very beneficial and responsive. I would say another would be cameras above traffic lights watching for speeders and getting their license plates. This is important because people who are being risky and causing hazards on the road will get a fat ticket and will be seeing court. They are less likely to run a red light if they see a camera watching. I hope this helps you!

3 0
2 years ago
Other questions:
  • Ben is writing web page content on a newly launched gaming gadget. He has to use hyperlinks to help visitors navigate to web pag
    11·1 answer
  • What tool listed below will be the most useful for developing presentation content?
    10·2 answers
  • I dopped my Fujifilm Instax mini 8 and now the case won't close and it takes blank pictures can anyone tell me what to do, pleas
    6·2 answers
  • Plagiarism occurs when writers
    14·2 answers
  • How much days are in a year
    9·2 answers
  • Digital certificates can be used for each of these EXCEPT _____. A. to encrypt channels to provide secure communication between
    13·1 answer
  • Why is data processing done in computer?​
    14·1 answer
  • What refers to a collection of small sections of code that are stored together to solve many everyday programs?
    11·2 answers
  • Internal exception java.net.socketexception connection reset 1.18
    8·2 answers
  • To behave ethically means
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!