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

 

abraskin@mbusd.org > digitP
prev  |  next  |  chance

Given a positive integer num and another positive integer p, return the digit found in the p place. p will never be greater than the number of digits found in num.


For example, given 1234 and 3, return the number in the 100's place: 2 and

given 56789 and 2, return the number in the 10's place: 8.

digitP(1234, 3) → 2
digitP(56789, 2) → 8
digitP(1, 1) → 1

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

public int digitP(int num, int p) { }

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