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

 

jebbert@volusia.k12.fl.us > ddd2FirstLastDigitProduct
prev  |  next  |  chance

Without using any string or array methods, write a method that returns the product of the first and last digits of the positive integer parameter. For example, if the parameter is 5218, return 40 since 5*8=40. If the parameter is a single-digit number, that digit will be considered BOTH the first AND last digit. For example, with the parameter 7, you would return 49 since 7*7=49 and 7 would be considered both the first and last digit.


ddd2FirstLastDigitProduct(5218) → 40
ddd2FirstLastDigitProduct(24141) → 2
ddd2FirstLastDigitProduct(42419) → 36

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

public int ddd2FirstLastDigitProduct(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: 240

Copyright Nick Parlante 2017 - privacy