using System;
class Program
{
static string GetRandomTwoDigits(int num) {
string s = num.ToString();
if (s.Length < 2) {
return "Error: number must have at least 2 digits";
}
Random rand = new Random();
int start = rand.Next(s.Length - 1);
return s.Substring(start, 2);
}
static void Main()
{
int num = 123456;
string randomTwo = GetRandomTwoDigits(num);
Console.WriteLine("Random two digits: " + randomTwo);
}
}
/*
run:
Random two digits: 45
*/