What will be printed out as a result of the following code execution:
 
namespace ConsoleApplication1 
{ 
     class Program 
    { 
         static void Main(string[] args) 
        { 

Console.Write(Test.Foo(1)+Test.Foo(2)*Test.Foo(3)); 

            Console.ReadLine(); 
        } 
    } 

    class Test 
    {
        public static int Foo(int o) 
       { 
           Console.Write(o);
           return o; 
       }
    }
 }
 
Explanation
Return value is calculated after all the method calls are executed
C#
C# Quiz
Start Quiz

or Read more about C# Quiz

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback