You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is a program to swap first and last digit of number.
You are given a non-negative integer number num and need swap the first and last digits of the number.
Complete the function swap_first_last(num) that takes a single parameter: num. It swaps the first and last digit of num and returns the resultant number.
Input:-
The first line contains the integer num.
Constraints:-
10 <= num <= 1025
Output:-
Print a single integer, result after swapping the first and last digits of num.
You are only expected to return the result, do not print it.