C/C Sample Test,Sample questions

If a is an array of 5 integers then which of the following is the correct way to increase its size to 10 elements?

1.int[] a = new int[5]; int[] a = new int[10];

2.int[] a = int[5]; int[] a = int[10];

3.int[] a = new int[5]; a.Length = 10 ;

4.int[] a = new int[5]; a = new int[10];

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

    int[] a = {11, 3, 5, 9, 4}; 
The array elements are created on the stack.
Refernce a is created on the stack.
The array elements are created on the heap.
On declaring the array a new array class is created which is derived from System.Array Class.
Whether the array elements are stored in the stack or heap depends upon the size of the array.


2.2, 3, 4

3. 2, 3, 5

4.4, 5

Which of the following statements are correct about the C#.NET code snippet given below?  int[ , ] intMyArr = {{7, 1, 3}, {2, 9, 6}}; intMyArr represents rectangular array of 2 rows and 3 columns. intMyArr.GetUpperBound(1) will yield 2. intMyArr.Length will yield 24. intMyArr represents 1-D array of 5 integers. intMyArr.GetUpperBound(0) will yield 2





Which one of the following statements is correct?

1.Array elements can be of integer type only.

2.The rank of an Array is the total number of elements it can contain.

3.The length of an Array is the number of dimensions in the Array.

4. The default value of numeric array elements is zero.


  1. C# MCQS -Programming (.NET Framework)
  2. C# MCQS -Programming(Control Instructions)
  3. C# MCQS - Functions and Subroutines(.NET Framework)
  4. C# Programming-Constructors
  5. C# Programming- Arrays
  6. C# Programming -Structures
  7. C# Programming-Properties
  8. C# Programming -Exception Handling
  9. C# Programming -Interfaces
  10. C# Programming -Delegates
  11. C# Programming -Generics
  12. C# Programming - Datatypes
  13. C# Programming- Operators
  14. C# Programming -Classes and Objects
  15. NET Programming mcqs
  16. Computer Science Engineering (CSE) .NET Programming
  17. C# Programming Mcq Set 1
  18. C# Programming Mcq Set 2
  19. C#.NET Programming Mcq
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!