id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

sspiege3@schools.nyc.gov > firstNumPrimes
prev  |  next  |  chance

Write method which takes two positive integer as its parameter, representing a start value and a number of values. The method returns an array of size num that contains the first num prime numbers that are greater than or equal to start.


firstNumPrimes(2, 2) → [2, 3]
firstNumPrimes(4, 3) → [5, 7, 11]
firstNumPrimes(1, 1) → [2]

...Save, Compile, Run (ctrl-enter)

public int[] firstNumPrimes( int start, int num) }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 200 Post-solution available

Copyright Nick Parlante 2017 - privacy