Solved

You Have a for Loop Nested in a While Loop

Question 29

True/False

You have a for loop nested in a while loop in order to find prime numbers. The proper way is to set the flag to false before starting the for loop that checks for factors. Inside the for loop, set the flag to true when a factor is found. After the for loop terminates, check the value of the flag. If it is still false, no factors were found and the number is prime.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions