xxxxxxxxxx
#include <stdio.h>
/**
* C program to find last digit of a number
*/
int main()
{
int n, lastDigit;
/* Input number from user */
printf("Enter any number: ");
scanf("%d", &n);
/* Get the last digit */
lastDigit = n % 10;
printf("Last digit = %d", lastDigit);
return (0);
}