beginnersumofdigitslogic
If Give an integer N . Write a program to obtain the sum of the first and last digits of this number.
#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;
}