14. WAP to get the last digit of a given number.

 

#include<stdio.h>

void main()

{

        int number,last_digit;

        printf("Enter a number : ");

        scanf("%d",&number);

        last_digit = number%10;

        printf("Last digit is : %d\n",last_digit);

}

Comments