What will be printed out as a result of the following code execution:
 
static bool Method1() 
{ 
       Console.WriteLine("in Method1"); 
       return false;
 }
 static bool Method2() 
{ 
       Console.WriteLine ("in Method2"); 
       return true; 
} 
static void Main(string[] args)
{ 
     if (Method1() & Method2())
     { 
          Console.WriteLine("inside if";); 
      } 
}
 
Explanation
& operator always evaluates the value of both operands
C#
C# Quiz
Start Quiz

or Read more about C# Quiz

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback