Advertisement
remote87

Third Digit is 7

Aug 28th, 2015
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 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 _05ThirdDigitIsSeven
  8. {
  9.     class ThirdDigitIsSeven
  10.     {
  11.         static void Main()
  12.         {
  13.             Console.Write("Enter a number: ");
  14.             string number = Console.ReadLine();          
  15.             char digit = number[number.Length - 3];
  16.             Console.WriteLine(digit=='7');
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement