Advertisement
ValerianBenchea

Verificare daca ultima cifra a unui numar este 0

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