Question: Help please!! I've tried these inputs but they have come out wrong: tempVal = userVal / 1000; tensDigit = tempVal % 10; and tensDigit =
Help please!! I've tried these inputs but they have come out wrong:
tempVal = userVal / 1000;
tensDigit = tempVal % 10;
and
tensDigit = userVal / 1000 % 10;
Jump to level 1 Integer userVal is read from input. Assume userVal is greater than 1000 and less than 99999 . Assign tensDigit with userVal's tens place value. Ex: If the input is 38796 , then the output is: The value in the tens place is: 9
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
