C#.NET Multiple choices


Total available count: 28
Subject - Microsoft Technologies
Subsubject - C#.NET

If you want a numeric real literal to be treated as decimal, which suffix to be used?


 

 

 

 



B


Solution:-

Real literals:-
The type of a real literal is determined by its suffix as follows: 
The literal without suffix or with the 'd' or 'D' suffix is of type double. The literal with the 'f' or 'F' suffix is of type float. The literal with the 'm' or 'M' suffix is of type decimal.

'M' means it's a decimal literal, as others have said. The decimal suffix is M/m since D/d was already taken by double. Although it has been suggested that M stands for money, Peter Golde recalls that M was chosen simply as the next best letter in decimal.

C# specifications:

var f = 0f; // float
var d = 0d; // double
var m = 0m; // decimal (money)
var u = 0u; // unsigned int
var l = 0l; // long
var ul = 0ul; // unsigned long

Note that you can use an uppercase or lowercase notation.




Next 2 multiple choice(s)

1

What is the default boolean value in C#?

2

What are the pillars of Object-Oriented Programming?

Comments