write a program to input a number and display its first and last digit is same or not
Answers
Answered by
5
Answer:
Explanation:Logic to find first and last digit of a number
Input a number from user. Store it in some variable say num . Find last digit using modulo division by 10 i.e. lastDigit = num % 10 . To find first digit we have simple formula firstDigit = n / pow(10, digits - 1)
Similar questions