Advertisement
ValerianBenchea

Ultima cifra dintr-un numar

Oct 21st, 2019
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.16 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.   int n, c;
  8.   cout<<"n=";
  9.   cin>>n;
  10.   c=n%10;
  11.   cout<<"Ultima cifra este "<<c;
  12.  
  13.     return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement