Write a C program to find first and last digit of the user input number, without using looping. Related Read:…