Computer Science, asked by swapanmukherjee1962, 4 months ago

Write a program in java to print prime numbers between 1 to 20.

Answers

Answered by masterrrrrrr
2

Answer:

class Prime. {

public static void main(String arg[]) {

int i,count; System. out. print("Enter n value : ");

Scanner sc=new Scanner(System. in); int n=sc. nextInt();

System. out. println("Prime numbers between 1 to "+n+" are "); for(int j=2;j<=n;j++)

{ count=0;

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

if(j%i==0) {

Answered by Anonymous
0

Answer:

9699690

Answer: 9699690 is the product of all prime numbers between 1-20 .

Similar questions
Math, 10 months ago