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

 

jebbert@volusia.k12.fl.us > sep27_2016_BONUS_primesBelow
prev  |  next  |  chance

Write a method that returns a string of all the prime numbers up to 'max'. Each prime number has a space after it, including the last one, so the string must end in a space. The value of 'max' will be between 2 and 1000. Part of this challenge is to write a program that does not use more memory than CodingBat allows and also does not time out.


sep27_2016_BONUS_primesBelow(2) → "2 "
sep27_2016_BONUS_primesBelow(4) → "2 3 "
sep27_2016_BONUS_primesBelow(5) → "2 3 5 "

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

public String sep27_2016_BONUS_primesBelow(int max) { }

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: 290

Copyright Nick Parlante 2017 - privacy