What Will Be The Correct Set Of C Code To Display The Value Of #17
What will be the correct set of C# code to display the value of given variable ‘c’ as ‘25.302’.
This multiple choice question (MCQ) is related to the book/course gs gs108 CSharp. It can also be found in gs gs108 Data Types, Variables and Operators - Floating and Decimal Data Types - Quiz No.1.
What will be the correct set of C# code to display the value of given variable ‘c’ as ‘25.302’.
float a = (double) 12.502f; float b = 12.80f; float c; c = (float) a + b; Console.Writeline(c); Console.ReadLine();
float a = 12.502D; float b = 12.80f; float c; c = a + b; Console.WriteLine(c); Console.ReadLine();
double a = 12.502; float b = 12.802f; float c; c = (float)a + b; Console.WriteLine(c); Console.ReadLine();
double a = (float) 12.502f; float b = 12.80f; float c; c = a + b; Console.WriteLine(c); Console.ReadLine();