1.

Your observationsineachoftheaboveproceduresinthechart.it was rubbeProcedureRepulsion / AttractionInferenceced straw is taken near the uncharged straw.rows carrying similar charges are brought nearthermed straw and the oppositely charged clothwas used for rubbing are brought near eachetrically charged objects attract uncharged objects. There is repulsionlike electric charges. There is attraction between unlike electric charges.repulsion is used as a test for identifying an electrically charged object.53​

Answer»

java.util.Scanner;public class FiftyPrimes{ // Return true if a number n is prime public static boolean isPrime(long n) { // Check division from 2 to sqrt(n) for (long i = 2; i <= Math.sqrt(n); i++) { if (n % i == 0) { return false; } } // If no division is found, number is prime return true; } public static VOID main(String[] args) { // Create Scanner object Scanner sc = new Scanner(System.in); // TAKE USER input System.out.print("Enter the starting point: "); long start = sc.nextInt(); // Close Scanner object sc.close(); // If start point is less than 2, make it 2 if (start < 2) { start = 2; } int numberOfPrimes = 0; // Number of PRIMES printed long number = start; // Number to be TESTED for prime // Iterate until 50 primes are printed while (numberOfPrimes < 50) { if (isPrime(number)) { System.out.println(number); numberOfPrimes++; } number++; } }}



Discussion

No Comment Found