IndiaBIX.com
Arithmetic Aptitude Data Interpretation
Logical Reasoning Verbal Reasoning Non Verbal Reasoning
General Knowledge
Sudoku Number puzzles Missing letters puzzles Logical puzzles Playing cards puzzles Clock puzzles
C Programming C++ Programming C# Programming Java Programming
Microbiology Biochemistry Biotechnology Biochemical Engineering
Civil Engineering Mechanical Engineering Chemical Engineering Networking Database Questions Computer Science Basic Electronics Digital Electronics Electronic Devices Circuit Simulation Electrical Enigneering Engineering Mechanics Technical Drawing
Placement Papers Group Disucssion HR Interview Technical Interview Body Language
Aptitude Test Verbal Ability Test Verbal Reasoning Test Logical Reasoning Test C Programming Test Java Programming Test Data Interpretation Test General Knowledge Test
Data Structures Operating Systems Networking DATABASE Database Basics SQL Server Basics SQL Server Advanced SQL Server 2008 JAVA Core Java Java Basics Advanced Java UNIX Unix File Management Unix Memory Management Unix Process Managemnt C Interview Questions The C Language Basics .NET Interview Questions .NET Framework ADO.NET ASP.NET Software Testing

C# Programming - Arrays

@ : Home > C# Programming > Arrays > General Questions

Exercise

  • General Questions
"I never see what has been done; I only see what remains to be done."
- Marie Curie
11. 

Which of the following statements is correct about the C#.NET code snippet given below?

    int[] intMyArr = {11, 3, 5, 9, 4}; 

A. intMyArr is a reference to an object of System.Array Class.
B. intMyArr is a reference to an object of a class that the compiler derives from System.Array Class.
C. intMyArr is a reference to an array of integers.
D. intMyArr is a reference to an object created on the stack.
E. intMyArr is a reference to the array created on the stack.

12. 

Which of the following is the correct way to define and initialise an array of 4 integers?

  1. int[] a = {25, 30, 40, 5};
  2. int[] a;
    a = new int[3];
    a[0] = 25;
    a[1] = 30;
    a[2] = 40;
    a[3] = 5;
  3. int[] a;
    a = new int{25, 30, 40, 5};
  4. int[] a;
    a = new int[4]{25, 30, 40, 5};
  5. int[] a;
    a = new int[4];
    a[0] = 25;
    a[1] = 30;
    a[2] = 40;
    a[3] = 5;

A. 1, 2
B. 3, 4
C. 1, 4, 5
D. 2, 4, 5
E. 5, 5

13. 

Which of the following is the correct output of the C#.NET code snippet given below?

    int[][] a = new int[2][];
    a[0] = new int[4]{6, 1, 4, 3};
    a[1] = new int[3]{9, 2, 7}; 
    Console.WriteLine(a[1].GetUpperBound(0));

A. 3B. 4
C. 7D. 9
E. 2

14. 

Which of the following is the correct way to obtain the number of elements present in the array given below?

    int[] intMyArr = {25, 30, 45, 15, 60};
  1. intMyArr.GetMax;
  2. intMyArr.Highest(0);
  3. intMyArr.GetUpperBound(0);
  4. intMyArr.Length;
  5. intMyArr.GetMaxElements(0);

A. 1, 2
B. 3, 4
C. 3, 5
D. 1, 5
E. 4, 5

15. 

What will be the output of the C#.NET code snippet given below?

namespace IndiabixConsoleApplication
{
    class SampleProgram
    {
        static void Main(string[ ] args)
        {
            int i, j;
            int[ , ] arr = new int[ 2, 2 ];
            for(i = 0; i < 2; ++i)
            {
                for(j = 0; j < 2; ++j)
                {
                    arr[i, j] = i * 17 + i * 17;
                    Console.Write(arr[ i, j ] + " ");
                }
            }
        }
    }
}

A. 0 0 34 34
B. 0 0 17 17
C. 0 0 0 0
D. 17 17 0 0
E. 34 34 0 0



© 2008-2013 by IndiaBIX™ Technologies. All Rights Reserved | Copyright | Terms of Use & Privacy Policy

Contact us: info@indiabix.com     Follow us on twitter!