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

 

orion.a.smith@gmail.com apcsa-primitives > apcsaPrimitivesSameMagnitude
prev  |  next  |  chance

Given two positive numbers, return true if they both have the same number of digits and false if they have different numbers of digits.

HINT
Math.log10(n) gives the log base 10 of n. Math.floor(n) rounds down to the integer at or below a given decimal number.

apcsaPrimitivesSameMagnitude(5, 8) → true
apcsaPrimitivesSameMagnitude(5, 81) → false
apcsaPrimitivesSameMagnitude(50, 81) → true

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

public boolean apcsaPrimitivesSameMagnitude(int a, int b) { }

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

Copyright Nick Parlante 2017 - privacy