MCQs > IT & Programming > C# > Consider the following code: class Program { static void Main(string[] args) { float f = double d = decimal dc = 0; PrintDouble(f); // Statement 1 PrintDouble(d); // Statement 2 PrintDouble(dc); // Statement 3 } static private void PrintDouble(double d) { Console.WriteLine(d.ToString()); } } Which of the following are true?

C# MCQs

Consider the following code:

class Program {

static void Main(string[] args) {

     float f =

     double d =

     decimal dc = 0;

     PrintDouble(f); // Statement 1

     PrintDouble(d); // Statement 2

     PrintDouble(dc);   // Statement 3

}

static private void PrintDouble(double d) {

     Console.WriteLine(d.ToString());

}

}

Which of the following are true?

Answer

Correct Answer: Statement 3 will generate a compilation error.

Explanation:

Note: This Question is unanswered, help us to find answer for this one

C# Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

C# Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it