Problem 51788. Make a Number From the First and Last Digit of an Input Number
In this problem, you will be provided with an integer input. You have to output a number made from the first and last digit of the input number. The ones part of the number should be the first digit and the tens part of the number should be the last digit of the input. Here you have to careful about the last digit. If the digit is zero, you have to take the second last digit and go on until you find a digit greater than zero.
You can assume that yu will get at least 2 non-zero digits in the input.
For example:
input: 4353636
output: 64
input: 123960
output: 61
Happy Coding!!!
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers33
Suggested Problems
-
Find the sum of all the numbers of the input vector
53478 Solvers
-
Project Euler: Problem 1, Multiples of 3 and 5
3657 Solvers
-
Return the first and last characters of a character array
11738 Solvers
-
Magic is simple (for beginners)
11058 Solvers
-
1051 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!