Home / CSE MCQs / C#.Net MCQs :: Discussion

Discussion :: C#.Net MCQs

  1. What will be the output of following code snippet?

    #define pi 
     using System;
     using System.Collections.Generic;
     using System.Linq;
     using System.Text;
     using System.Threading.Tasks;
     
     namespace ConsoleApplication13
    {
        class Program
        {   
            static void Main(string[] args)
            {
                #if (!pi) 
                Console.WriteLine("i");
                #else 
                Console.WriteLine("pi not define");
                #endif
                Console.WriteLine("ok");
                Console.ReadLine();
           }
       }
    }
  2. A.

    i

    pi not define

    B.

    pi not define

    ok

    C.

    i

    ok

    D.

    ok

    View Answer

    Workspace

    Answer : Option B

    Explanation :



Be The First To Comment