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

 

norm.krumpe@muohio.edu program10 > factorCount
prev  |  next  |  chance

A positive integer f is said to be a "factor" of positive integer n if dividing n by f leaves a remainder of zero. For example, 1, 2, 5, and 10 are the only factors of 10. 17 has only 2 factors, 1 and 17. 1 has only 1 factor, 1. Given a positive integer, return the number of factors it has.


factorCount(10) → 4
factorCount(17) → 2
factorCount(-15) → 0

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

int factorCount(int n) { }

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

Copyright Nick Parlante 2017 - privacy