gs gs108 Arrays and Strings - Use of Variable Arguements - 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) { object[] a = {" 1 ", 4.0f, " harsh "}; fun(a); Console.ReadLine(); } static void fun(params object[] b) { for (int i = 0; i < b.Length - 1; i++) Console.WriteLine(b[i] + " "); }
static void Main(string[] args) { int [] a = {1, 2, 3, 4, 5}; fun(a); Console.ReadLine(); } static void fun(params int[] b ) { int[] k = { 3, 4, 7, 8,'\0' }; for (int i = 0; i < b.Length; i++) { b[i] = b[i] + k[i] ; Console.WriteLine( b[i] + " "); } }
static void Main(string[] args) { int [] a = {1, 2, 3, 4, 5}; fun(a); Console.ReadLine(); } static void fun(params int[] b ) { for (int i = 0; i < b.Length; i++) { b[i] = b[i] * 5 ; Console.WriteLine(b[i] + ""); } }
static void Main(string[] args) { int[] a = {2, 21, 34, 46, 85, 88, 90}; fun(a); Console.ReadLine(); } static void fun(params int[] b) { int[] c = {1, 2, 3, 4, 5, 6, 7}; int i, j = 0; for (i = 0; i < b.Length; i++) if (b[i] % 2 == 0) { c[j++] = b[i]; } for (i = 0; i < j; i++) { Console.Write(c[i] + " "); } }
void func(int[] x) { }
void func(int x) { }
void func(param int[]) { }
void fun(param int[] x) { }
static void Main(string[] args) { int[] x = { 80, 82, 65, 72, 83, 67 }; fun(x); Console.ReadLine(); } static void fun(params int [] b ) { int i; for (i = 5; i >=0 ; i--) { Console.WriteLine(Convert.ToChar(b[i])); } }
static void Main(string[] args) { int[] x = {65, 66, 67, 68, 69, 70}; fun(x); Console.ReadLine(); } static void fun(params int[] b ) { int i; for (i = 5; i > 0 ; i--) { b[i] = b[i] + 32; Console.WriteLine(Convert.ToChar(b[i])); } }