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

 

tmhscs@gmail.com arrays > array_optimusPrime
prev  |  next  |  chance

array_optimusPrime -- This method takes an integer called num and returns an integer array that stores all the prime numbers between 1 and num. Precondition: num >= 0.


array_optimusPrime(100) → [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]
array_optimusPrime(0) → []
array_optimusPrime(1) → []

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

public int[] array_optimusPrime(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

Post-solution available

Copyright Nick Parlante 2017 - privacy