Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Threading;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.Write("Start typing your numbers//TYPE 'END' TO STOP THE PROGRAM//: ");
- PalindromeIntegers();
- }
- static void PalindromeIntegers()
- {
- string int1;
- while((int1 = Console.ReadLine()) != "END")
- {
- string alternativeString = "";
- int stringLength = int1.Length;
- for(int i = stringLength - 1; i >= 0; i--)
- {
- alternativeString += int1[i];
- }
- if (int1.Equals(alternativeString))
- {
- Console.WriteLine("true");
- }
- else
- {
- Console.WriteLine("false");
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment