Computer Science, asked by vutukurivenkata405, 4 months ago

write a program to find the sum of 10 prime numbers in java​

Answers

Answered by Anonymous
0

Answer:

moJava Program to Print Prime Numbers from 1 to N

public class PrintPrimeNumbers1 {

public static void main(String[] args)

{

int i, number, count;

System.out.println(" Prime Numbers from 1 to 100 are : ");

for(number = 1; number <= 100; number++)

{

count = 0;

for (i = 2; i <= number/2; i++)

{

if(number % i == 0)

{

count++;

break;

}

}

if(count == 0 && number != 1 )

{

System.out.print(number + " ");

}

}

}

}

Similar questions