Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. int numar;
  2. numar = Convert.ToInt32(Console.ReadLine());
  3. int numarInitial, numarInvers = 0;
  4. numarInitial = numar;
  5. while(numar > 0)
  6. {
  7. int c = numar % 10;
  8. numarInvers = numarInvers * 10 + c;
  9. numar = numar / 10;
  10. }
  11. if (numarInitial == numarInvers)
  12. Console.WriteLine("Da");
  13. else
  14. Console.WriteLine("Nu");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement