#include

main ()
{
int number, last_digit, first_digit, total;
printf ("Enter the number which is to be Work out: ");

scanf ("%d", &number);


last_digit = number % 10;

total = last_digit;

first_digit = (number / 1000) % 10;

total = total + first_digit;

printf ("The total of the first and the last digit of the entered number is: %d", total);

}

Comments (0)

CSS Menu Samples