#include <stdio.h>

int main() {
    int num;
    int first_digit;
    int last_digit;
    int sum;

    printf("Enter a number: ");
    scanf("%d", &num);

    // find the first digit of the number
    first_digit = num;
    while (first_digit >= 10) {
        first_digit /= 10;
    }

    // find the last digit of the number
    last_digit = num % 10;

    // calculate the sum of the first and last digits
    sum = first_digit + last_digit;

    printf("Sum of first and last digit: %d\n", sum);

    return 0;
}