I could write the program quickly, but I want to leave you part of the fun.
Just write a loop for the numbers from 2-100 (1 is not considered a Prime number). Write a second loop to test divisibility of each number, "n", with all factors lower than that number (from 2 to n-1). If such a factor exists, the number is NOT a prime number.
To test for divisibility, use the remainder of a division.
if (n % factor == 0)
// If true, it is divisible.
Copyright © 2026 eLLeNow.com All Rights Reserved.