Home / MCQ Bank / Computer
Computer Classes And Objects In C Sharp

What will be the output of the following C# code? class sample { public int i; public int[] arr = new int[10]; public void fun(int i, int val) { arr[i] = val; } } class Program { static void Main(string[] args) { sample s = new sample(); s.i = 10; sample.fun(1, 5); s.fun(1, 5); Console.ReadLine(); } }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option A • sample.fun(1, 5) will not work correctly

Related Computer Questions

Can linear search recursive algorithm and binary search recursive algorithm be performed on an unordered list? Which of the following is not a way to complete a cell entry? Which algorithm is used for searching in an unordered linked list? The development environment offers which standard construct for data validation Correct way of declaration of object of the following class is? class name