gs gs108 Object Oriented Concepts - Method Overloading - 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 Object Oriented Concepts. 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.
class Program { static void Main(string[] args) { Console.WriteLine( vol(10)); Console.WriteLine( vol(2.5f, 5)); Console.WriteLine( vol( 5l, 4, 5)); Console.ReadLine(); } static int vol(int x) { return(x * x * x); } static float vol(float r, int h) { return(3.14f * r * r * h); } static long vol(long l, int b, int h) { return(l * b * h); } }
1000 0 100
0 0 100
1000 98.125 100
static void Main(string[] args) { int i = 5; int j = 6; add(ref i); add(6); Console.WriteLine(i); Console.ReadLine(); } static void add(ref int x) { x = x * x; } static void add(int x) { Console.WriteLine(x * x * x); }
25 0
216 0
216 25
class maths { public static void fun1() { Console.WriteLine("method 1 :"); } public void fun2() { fun1(); Console.WriteLine("method 2 :"); } public void fun2(int k) { Console.WriteLine(k); fun2(); } } class Program { static void Main(string[] args) { maths obj = new maths(); maths.fun1(); obj.fun2(20); Console.ReadLine(); } }
method 1: method 2: 20 method 1:
method 2: 20 method 1: method 1:
method 1: 0 method 2: method 2:
method 1: 20 method 1: method 2: