gs gs108 Arrays and Strings - Array and Initialization - Quiz No.1
gs gs108 CSharp Quiz
This quiz belongs to book/course code gs gs108 CSharp of gs organization. We have 110 quizzes available related to the book/course CSharp. This quiz has a total of 10 multiple choice questions (MCQs) to prepare and belongs to topic Arrays and Strings. NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to prepare online MCQs and quizzes.
NVAEducation also facilitates users to contribute in online competitions with other students to make a challenging situation to learn in a creative way. You can create one to one, and group competition on an topic of a book/course code. Also on NVAEducation you can get certifications by passing the online quiz test.
static void Main(string[] args) { int i, j; int[, ] arr = new int[ 3, 3]; for (i = 0; i < 3; ++i) { for (j = 0; j < 3; ++j) { arr[i, j] = i * 2 + i * 2; Console.WriteLine(arr[i, j]); } Console.ReadLine(); } }
int[][]a = new int[2][]; a[0] = new int[3]{3, 4, 2}; a[1] = new int[2]{8, 5}; foreach( int[]i in a) { /* add for loop */ console.write( j+ " "); console.writeline(); }
int[] a= {11, 3, 5, 9, 6};
int[, ]a={{5, 4, 3},{9, 2, 6}};
static void Main(string[] args) { Program p = new Program(); p.display(2, 3, 8); int []a = { 2, 56, 78, 66 }; Console.WriteLine("example of array"); Console.WriteLine("elements added are"); p.display(a); Console.ReadLine(); } public void display(params int[] b) { foreach (int i in b) { Console.WriteLine("ARRAY IS HAVING:{0}", i); } }
int[] a; a = new int[3]; a[1] = 78; a[2] = 9; a[3] = 54;
int[] a; a = new int{78, 9, 54};
int[] a; a = new int[3]{78, 9, 54};