What will be the output of the following C# code? static void Main(string[] args) { ...
View QuestionDefault Type of number without decimal is?
a) Long Int b) Unsigned Long c) Int d) Unsigned Int Answer: c Explanation: By definition.
View QuestionCorrect way to assign values to variable ‘c’ when int a=12, float b=3.5, int c;
a) c = a + b; b) c = a + int(float(b)); c) c = a + convert.ToInt32(b); d) c ...
View Question
Which Conversion function of ‘Convert.TOInt32()’ and ‘Int32.Parse()’ is efficient?
i) Int32.Parse() is only used for strings and throws argument exception for null string
ii) Convert.Int32() used for data types and returns directly ‘0’ for null string
Which Conversion function of ‘Convert.TOInt32()’ and ‘Int32.Parse()’ is efficient? i) Int32.Parse() is only used for strings and throws ...
View QuestionWhich data type should be more preferred for storing a simple number like 35 to improve execution speed of a program?
a) sbyte b) short c) int d) long Answer: a Explanation: Wider data type like ...
View QuestionArrange the following data type in order of increasing magnitude sbyte, short, long, int.
a) long < short < int < sbyte b) sbyte < short < int < long c) short < ...
View Question
What will be the error in the following C# code?
Static Void Main(String[] args)
{
const int m = 100;
int n = 10;
const int k = n / 5 * 100 * n ;
Console.WriteLine(m * k);
Console.ReadLine();
}
What will be the error in the following C# code? Static Void Main(String[] args) { ...
View QuestionCorrect Declaration of Values to variables ‘a’ and ‘b’?
a) int a = 32, b = 40.6; b) int a = 42; b = 40; c) int a ...
View QuestionChoose “.NET class” name from which data type “UInt” is derived?
a) System.Int16 b) System.UInt32 c) System.UInt64 d) System.UInt16 Answer: b Explanation: By Definition class assigned to i) System.Int16 = ...
View QuestionHow many Bytes are stored by ‘Long’ Data type in C# .net?
a) 8 b) 4 c) 2 d) 1 Answer: a Explanation: ‘Long’ is the data type keyword used for storing data ...
View Question