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

 

quiz2021_10_12_APSLHL_removeOnes


Write a method that returns the positive integer input parameter, but with the one's place replaced with zero. For example, 1287 would return 1280. 28174 would return 28170. As noted, you may assume that the input parameter is positive. Look at the test data for more examples. Don't forget about the "mod" operator "%"!!!


quiz2021_10_12_APSLHL_removeOnes(4) → 0
quiz2021_10_12_APSLHL_removeOnes(142) → 140
quiz2021_10_12_APSLHL_removeOnes(8327) → 8320

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

public int quiz2021_10_12_APSLHL_removeOnes(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

Difficulty: 220

Copyright Nick Parlante 2017 - privacy