Why does this work the way it does

I see this code:

Console.WriteLine("Type any number:  ");

int x;

if (int.TryParse(Console.ReadLine(), out x))
{
    //correct input
}
else
{
    //wrong input
}

and so far to my knowledge I know that for an if statement right after the if is the condition witch is true or false and if it’s true the first block executes if it’s false then the second block executes but in my mind I see that int.tryparse(console.readline(), out x) doesn’t fit the description of either being true or false(I guess cause the whole thing doesn’t look like a false or true statement/condition but the if still takes it) I don’t see how it’s supposed to evaluate to either true or false am I supposed to see it as if the value input is a string then
Was this page helpful?