Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Problem_5_ThirdDigitIs7
- {
- class ThirdDigitIs7
- {
- static void Main()
- {
- Console.Write("Enter the integer number: ");
- int n = int.Parse(Console.ReadLine());
- string nStr = n.ToString();
- if (nStr.Length >= 2)
- {
- if (nStr[nStr.Length - 3] == '7')
- {
- Console.WriteLine("true");
- }
- else
- {
- Console.WriteLine("false");
- }
- }
- else
- {
- Console.WriteLine("false");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement