Reputation: 29
If the input is numerical then run numPalindrome()
.
If the input is alphabetical then run strPalindrome()
.
static void Main(string[] args)
{
Console.Write("Enter your Input: ");
var input = Console.ReadLine();
if (What to do?????)
{
strPalindrome();
}
else
{
numPalindrome();
}
}
Upvotes: 0
Views: 225
Reputation: 2457
if(int.TryParse(input, out int value))
{
// input is an int, call numPalindrome(value)
}
else
{
// input is not an int, call strPalindrome()
}
Upvotes: 6