0% found this document useful (0 votes)
21 views

Auto-Generated Method Stub

This Java code takes a number as a command line argument, divides it by numbers 2 through 9, and prints whether each division has a remainder of 0, determining if the number is prime or not prime for those divisors. It takes the number, divides it by each integer from 2 to 9, and outputs whether each division resulted in a remainder of 0 or not.

Uploaded by

arber
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Auto-Generated Method Stub

This Java code takes a number as a command line argument, divides it by numbers 2 through 9, and prints whether each division has a remainder of 0, determining if the number is prime or not prime for those divisors. It takes the number, divides it by each integer from 2 to 9, and outputs whether each division resulted in a remainder of 0 or not.

Uploaded by

arber
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

import java.text.

*;
public class PrimeTest {
public static void main(String[] args) {
// TODO Auto-generated method stub
int numri = new Integer(args[0]).intValue();
int prim2 = numri % 2;
boolean tf2 = (prim2 == 0);
System.out.println(numri + " plotpjesetohet me 2:" + tf2 );
int prim3 = numri%3;
boolean tf3 = (prim3 == 0);
System.out.println(numri + " plotpjesetohet me 3:" + tf3 );
int prim4 = numri%4;
boolean tf4 = (prim4 == 0);
System.out.println(numri + " plotpjesetohet me 4:" + tf4 );
int prim5 = numri%5;
boolean tf5 = (prim5 == 0);
System.out.println(numri + " plotpjesetohet me 5:" + tf5 );
int prim6 = numri%6;
boolean tf6 = (prim6 == 0);
System.out.println(numri + " plotpjesetohet me 6:" + tf6 );
int prim7 = numri%7;
boolean tf7 = (prim7 == 0);
System.out.println(numri + " plotpjesetohet me 7:" + tf7 );
int prim8 = numri%8;
boolean tf8 = (prim8 == 0);
System.out.println(numri + " plotpjesetohet me 8:" + tf8 );

}
}

int prim9 = numri%9;


boolean tf9 = (prim9 == 0);
System.out.println(numri + " plotpjesetohet me 9:" + tf9 );

You might also like