I am facing a problem in dealing with basic if else statement in C#.
I have two variables of type uint. I need to check whether the first variable is in the range of the second one. Also, the first variable can have value null. The output comes up fine in case of i put some value for the first value. But the desired output fails in case I put null in the first variable
I did it in this manner.
using System;
public class Test
{
public static void Main()
{
uint var1 = 0x00000000;
uint var2 = 0x0ffffffa;
if (!((var1 == null) || (((var1 != null) && (var1 & var2)) > 0)))
Console.WriteLine ("no");
else
Console.WriteLine ("yes");
}
}
But the error is but the output is coming as "no". Where am I going wrong?
Aucun commentaire:
Enregistrer un commentaire