Set - 9

Question 31 :

What will be the output of the following code snippet?

using System;
class MainClass{
	static void Main( ){
		new MainClass().Display( 3.56 );
	}

	private void Display( float anArg ){
		Console.Write( "{0} {1}", anArg.GetType(), anArg );
	}

	double Display( double anArg ){
		Console.Write( "{0} {1}", anArg.GetType(), anArg );
		return anArg;
	}

	public decimal Display( decimal anArg ){
		Console.Write( "{0} {1}", anArg.GetType(), anArg ); return anArg;
	}
}

* System.Single 3.56
* System.Float 3.56
* System.Double 3.56
* System.Decimal 3.56

Answer :

System.Double 3.56


Question 32 :

What will be output for the given code?

Dim I as integer = 5
Do
I = I + 2
Response.Write (I & " ")
Loop Until I > 10

* 5 8
* 5 7 9
* 7 9 11
* Errors out 

Answer :

7 9 11 (if corrected)