Solved

You Have a for Loop Nested in a While Loop

Question 28

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

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents