Question: Problem: Given an integer as a starting value, identify the next thirty prime numbers that are greater than or equal to the input value. The
Problem: Given an integer as a starting value, identify the next thirty prime numbers that are greater than or equal to the input value. The results will be stored in a thirty-element array and must be displayed on two separate lines, those at even-indexes first and odd-indexes second. Example Execution #1: Enter starting value: 23 Even-index elements: 23 31 41 47 59 67 73 83 97 103 109 127 137 149 157 Odd-index elements: 29 37 43 53 61 71 79 89 101 107 113 131 139 151 163 Example Execution #2: Enter starting value: 377 Even-index elements: 379 389 401 419 431 439 449 461 467 487 499 509 523 547 563 Odd-index elements: 383 397 409 421 433 443 457 463 479 491 503 521 541 557 569 Example Execution #3: Enter starting value: 0 Even-index elements: 1 3 7 13 19 29 37 43 53 61 71 79 89 101 107 Odd-index elements: 2 5 11 17 23 31 41 47 59 67 73 83 97 103 109 Example Execution #4: Enter starting value: -4 Error! Non-negative values only!!! Enter starting value: -5 Error! Non-negative values only!!! Enter starting value: 91 Even-index elements: 97 103 109 127 137 149 157 167 179 191 197 211 227 233 241 Odd-index elements: 101 107 113 131 139 151 163 173 181 193 199 223 229 239 251
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
