Home » Aptitude Questions and Answers » C# Aptitude Questions and Answers

C# Arrays Aptitude Questions and Answers | Set 1

C# Arrays Aptitude Questions | Set 1: This section contains aptitude questions and answers on C# Arrays.
Submitted by Nidhi, on April 01, 2020

1) There are following statements are given below, which of them are correct about arrays in C#.NET?
  1. Arrays are not available in C#.NET
  2. An array is a group of similar data elements.
  3. We can create an array for integers, doubles, bytes, strings, etc.
  4. In C#.Net, Array is a predefined class.

Options:

  1. Only A
  2. Only B
  3. B, C, and D
  4. Only C

2) Is it possible to create an array of objects?
  1. Yes
  2. No

3) What is the correct way to declare and initialize an array of characters with 4 elements?
  1. char []ch = { 'A', 'C', 'D', 'E'};
  2. char ch[] = { 'A', 'C', 'D', 'E'};
  3. char ch{} = { 'A', 'C', 'D', 'E'};
  4. char ()ch = { 'A', 'C', 'D', 'E'};

Options:

  1. A
  2. B
  3. C
  4. D

4) There are following statements are given below, which of them are correct about given code snippet in C#.NET?
    int []arr = {5,0,10,20,4};
  1. It is not a proper way to create an array.
  2. Here we are creating an array of 5 integer elements.
  3. Here arr is a reference to the array created on the stack.
  4. We need to use curly braces to create an array in C#.NET.

Options:

  1. Only A
  2. Only B
  3. C and D
  4. A and D

5) Can we create a jagged array in C#.NET?
  1. Yes
  2. No






Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.





Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.