csharp and

Code Example - csharp and

                
                        //the and operator in c sharp is "&&" (hold shift and 6 ;))
if(a == 0 && b == 0)
{
  //both a and b is 0	
}
                    
                
 

csharp or

                        
                                if (true || false) { //Checks if either side is true
  Console.WriteLine("One is true");
}

if (false || false) {
  Console.WriteLine("Both are false");
}

//Output:
//One is true
                            
                        
 

Related code examples