41. What is the correct syntax to declare a nullable integer variable in C#?
42. What is the purpose of the 'unchecked' keyword in C#?
43. What is the output of the following code: Console.WriteLine($"5 + 5 = {5 + 5}");
44. What is the correct way to declare and initialize a string variable in C#?
45. Which of the following is NOT a valid C# data type?
46. Type of Conversion in which compiler is unable to convert the data type implicitly is?
47. Choose ".NET class" name from which data type "UInt" is derived?
48. Syntax for declaration and initialization of data variable is?
49. What will be the output of the following C# code?
class Program
{
static void Main(string[] args)
{
int i;
for ( i = 0; i < 5; i++)
{
}
Console. WriteLine(i);
Console. ReadLine();
}
}
class Program
{
static void Main(string[] args)
{
int i;
for ( i = 0; i < 5; i++)
{
}
Console. WriteLine(i);
Console. ReadLine();
}
}
50. For the following C# code select the relevant solution for conversion of data type.
static void Main(string[] args)
{
int num1 = 20000;
int num2 = 50000;
long total;
total = num1 + num2;
Console.WriteLine("Total is : " +total);
Console.ReadLine();
}
static void Main(string[] args)
{
int num1 = 20000;
int num2 = 50000;
long total;
total = num1 + num2;
Console.WriteLine("Total is : " +total);
Console.ReadLine();
}
Read More Section(Basic Syntax and Data Types in C Sharp)
Each Section contains maximum 100 MCQs question on Basic Syntax and Data Types in C Sharp. To get more questions visit other sections.