thegrudge

ThirdDigitIs7

Nov 11th, 2014
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.28 KB | None | 0 0
  1. using System;
  2. class ThirdDigitIs7
  3. {
  4.     static void Main()
  5.     {
  6.         int input = int.Parse(Console.ReadLine());
  7.         int thirdDigit = (input / 100) % 10;
  8.         bool isItSeven = thirdDigit == 7;
  9.         Console.WriteLine("Third digit is 7? {0}", isItSeven);
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment