MuffinMonster

Class Task 9#

Oct 8th, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication4
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int i1, i2;
  14.             Console.WriteLine("Enter a number:");
  15.             i1 = int.Parse(Console.ReadLine());
  16.             i2 = i1 % 100;
  17.             while (i1 > 100)
  18.             {
  19.                 i1 /= 10;
  20.             }
  21.             if (i1 == i2)
  22.             {
  23.                 Console.WriteLine("The two first digits and two last digits are same!");
  24.             }
  25.             else
  26.             {
  27.                 Console.WriteLine("The two first digits and two last digits are different!");
  28.             }
  29.             Console.ReadKey();
  30.         }
  31.     }
  32. }
Add Comment
Please, Sign In to add comment