answersLogoWhite

0

One solution is to use a for-loop counting from 1 to half of the number. If the modulus of the number and the current value in the loop is zero, the current value is a factor of the number. The number divided by the current value is also a factor.

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

What is javadoc?

write a java program to display "Welcome Java" and list its execution steps.


What Program that will display the even numbers in data structures and algorithms?

JAVA


How do you get a Java program to display a backslash in output without it interpreting it as a program command?

Follow the backslash with another backslash: System.out.println("\\ " \"); will display \ " \ on the screen.


Write a java program to display the number is prime or not?

Simply use a for loop (i) that runs from 2 to N-1. Checking if N % i 0 then its a prime number.


Write a program in java to display a string message using Servlets?

i dont no string for servlate


Can you get a Java program to find the cube of a number?

Yes


What do you mean by multithread program in java?

A Program in Java that spawns multiple threads is called a multithreaded program in Java.


Will you give us 10 to 15 different projects of advance java so that we can study advance java?

A good program display a model of human cells, and test different mutations.


Develop an algorithm to display all prime numbers from 2 to 100 Give both the pseudocode version and the flowchart version Convert your pseudocode into a Java program?

Develop an algorithm to display all prime numbers from 2 to 100. Give both the pseudocode version and the flowchart version. Convert your pseudocode into a Java program.


Write a program to display the even number series using for loop?

int maxNum = 1000; for(int i = 0; i <= maxNum; i += 2) { // Java solution System.out.println(i); // C solution printf("%d\n", i); }


List out the version of java?

Running "java -version" will display the current version of Java.


How to Write a java program to display hello?

public class Hello{public static void main(String [] args){System.out.println("Hello");}}