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

 

isPrime


Given integer num1, determine if it is prime. A prime number is only divisible by itself and 1. For instance, 7 is prime because it is only evenly divisible by 1 and 7 ( itself ). 8 is not prime because it has the divisors : 1,2,4,8


isPrime(4) → false
isPrime(2) → true
isPrime(5) → true

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

public boolean isPrime(int num1){ }

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