I'm trying to multiply two numbers and then reverse the answer and then compare the original value with the reversed value to see if they are the same numbers. After I reverse the value how do I set it back to an int
or a string
so I can compare them?
int i = 0;
var x = Enumerable.Range(100,999);
var y = Enumerable.Range(100,999);
foreach (var xValue in x)
{
foreach (var yValue in y)
{
i = (xValue * yValue);
var t = i.ToString();
var tempt = t.Reverse();
var temp = new string(tempt);
if (i.ToString() == temp)
{
}
}
}