var numar:longint;begin write ('Introduceti numarul: ');readln(numar);
writeln('Ultima cifra este:',numar mod 10);end.Iar varianta C++
#include<iostream>
using namespace std;
int main()
{
long numar;
cin>>numar;
cout<<"Ultima cifra a acestui numar este:"<<numar%10;
return 0;
}