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

Discussion :: C#.Net MCQs

  1. What is the output for the following code ?

    static void Main(string[] args)
     {
         int a = 15, b = 10, c = 1;
         if (Convert.ToBoolean(a) && (b > c))
         {
             Console.WriteLine("cquestionbank");
         }
         else
         {
             break;
         }
     }
  2. A.
    cquestionbank
    B.
    It will print nothing
    C.
    Compile time error
    D.
    Run time error

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    Keyword "break is not part of if-else statement.This keyword is used in case of loop or switch case statement.


Be The First To Comment