#include <iostream>
      using namespace std;
      typedef long long ll;
      int main() {
      		ll n,last,first;
      		cin>>n;
      		last=n%10;
      		while(n>=10)
      		{
      			n=n/10;
      		}
      		first=n;
      		cout<<last+first<<"\n";
      	return 0;
      }
      

      Python language logo
      FirstSumLast

      beginner
      sumofdigits
      logic

      If Give an integer N . Write a program to obtain the sum of the first and last digits of this number.

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.