Sandeep Soni
What Will Be The Output Of The Following Code Snippet:public class Quiz{public static void Main(string[] args){int[] i = new int[0];Console.WriteLine(i[0]);}}a) 0 b) Nothing is printed as array is empty c) Compile time error d) IndexOutOfRangeException e) 1
By Sandeep Soni in .NET on Nov 14 2018
  • Manoth Kumar
    Nov, 2018 26

    The answer is d) IndexOutofRangeException, the number of elements in the array is 0 and the program is trying to access the first element in the array.

    • 3
  • srinivas rao
    Sep, 2019 3

    Index out of Range

    • 0
  • Sonu Gupta
    Aug, 2019 19

    d) IndexOutOfRangeException

    • 0
  • Rakesh E
    Jun, 2019 24

    b

    • 0
  • siva b
    Mar, 2019 12

    d.IndexOutOfRangeException. it will accept the first argument from index of "1".

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS