Page 1 of 1

2.10 Nested Loopi outer loop count 2 prime ← "yes" while count
Posted: Thu May 26, 2022 9:11 am
by answerhappygod
2 10 Nested Loopi Outer Loop Count 2 Prime Yes While Count X And Prime Equals Yes Inner Loop If X Count Has No 1
2 10 Nested Loopi Outer Loop Count 2 Prime Yes While Count X And Prime Equals Yes Inner Loop If X Count Has No 1 (52.85 KiB) Viewed 20 times
2.10 Nested Loopi outer loop count 2 prime ← "yes" while count <x and prime equals "yes" { inner loop if x/count has no remainder prime ← "no" else count count + 1 if prime equals "yes" and x > largest Prime largest Prime ← x print "Enter a number (negative to quit): " input x } if largest Prime equals 1 print "No prime numbers were entered." else print "The largest prime number entered was " + largest Prime + "" Figure 2.13 Algorithm that finds the largest prime number from a user-entered list of numbers largest Prime ← 1 print "Enter a number (negative to quit): input x while x ≥ 0 {