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

 

amjadm@miamioh.edu > swapLastDigits
prev  |  next  |  chance

Given 2 positive ints n1 and n2, swap the last digit of the value inside the n1 with the last digit of n2, and return the new value of the parameter n1.


swapLastDigits(12, 3) → 13
swapLastDigits(1, 2) → 2
swapLastDigits(111, 22) → 112

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

public int swapLastDigits(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: 120

Copyright Nick Parlante 2017 - privacy