If operators
Ok I think I know the answer to this but I am going to ask anyway, I an still very new to c#.
Is there any way to put an or operator into an if statement:
If (lcAge == 21 or lcAge == 22)
Or does it have to be:
If(lcAge == 21)
{
}
else if(lcAge == 22)
{
}
if it has to be the latter, how do you code get around duplicating code? Do you call functions within the if statements?
If(lcAge == 21)
{
CheckAge();
}
else if(lcAge == 22)
{
CheckAge();
}
sorry for the level of question
many thanks,
Craig
david 0Posted Oct 24, 2003, 7:34 AM
c_wileyPosted Oct 24, 2003, 4:36 AM
katanaPosted Oct 23, 2003, 5:34 PM
buchholzPosted Oct 23, 2003, 12:22 PM
jamesPosted Oct 23, 2003, 12:15 PM