coasterka

#3IsTheThirdDigit7

Mar 13th, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.29 KB | None | 0 0
  1. static void Main()
  2.         {
  3.             Console.WriteLine("Enter a number to check if its third digit from right-to-left is 7:");
  4.             int userNum = int.Parse(Console.ReadLine());
  5.             bool isSeven = ((userNum / 100) % 10) == 7;
  6.             Console.WriteLine(isSeven);
  7.         }
Advertisement
Add Comment
Please, Sign In to add comment