The document presents a Java program that checks if a given number is prime. It uses a loop to count the number of factors of the input number and determines if it is prime based on whether the count equals two. Key variables include 'n' for the user input, 'i' for iteration, and 'count' for tracking factors.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
4 views1 page
Check Prime
The document presents a Java program that checks if a given number is prime. It uses a loop to count the number of factors of the input number and determines if it is prime based on whether the count equals two. Key variables include 'n' for the user input, 'i' for iteration, and 'count' for tracking factors.