C# Test 2
C# Test 2
C# Test 2
Good try! You gave 11 correct answers out of 20 questions in 13:41 minutes.
int i;
Console.WriteLine(i);
A Random value
B 0
C Runtime error
D Compile-time error
int i = 5, j;
Console.WriteLine(j=i*2);
A 0
B 10
C Runtime error
D Compile-time error
int k;
display(k);
Console.Write(val);
A null
B 0
C Compile-time error
https://www.tutorialsteacher.com/online-test/csharp-test2 1/7
7/16/2021 C# Test 2
D Runtime error
Question 4: Which of the following keyword is used to declare a variable whose type will be
automatically determined by the compiler?
A dynamic
B var
C this
D null
Question 5: Which of the following data types can include maximum positive or negative,
integer or float value?
A double
B long
C decimal
D BigInteger
int a = 1, b = 2, c = 3;
Console.Write ((a*b)+(b*c));
Console.Write ((a*b)+(b*c)-c);
A 8, 5
B 9, 5
C 7,5
D 9,6
A Public
B Private
C Internal
D Protected
https://www.tutorialsteacher.com/online-test/csharp-test2 2/7
7/16/2021 C# Test 2
A True
B False
str1 = "C#";
str2 = "C#";
Console.Write(Object.ReferenceEquals(str1, str2));
A True
B False
C Compile-time error
D Runtime error
Console.WriteLine($"{greet} {name}");
A Hello {name}
B Hello Steve
C {Hello} {Steve}
D Compile-time error
int i = 0;
for(;;)
if (i < 5)
Console.Write(i);
else
break;
i++;
https://www.tutorialsteacher.com/online-test/csharp-test2 3/7
7/16/2021 C# Test 2
A 01234
B 12345
C Infinite loop
D Compile-time error
Question 12: The members of the enum are always public, and no access modifiers can be
applied.
A True
B False
{2, true},
{1,"one"},
};
foreach(DictionaryEntry kvp in sortedList )
Console.Write(kvp.Value);
https://www.tutorialsteacher.com/online-test/csharp-test2 4/7
7/16/2021 C# Test 2
A Compile-time error
B Runtime error
C 12
D OneTrue
try
return arr[10];
catch(Exception ex){
Console.WriteLine("Error occurred!");
finally{
return 0;
A Error occurred!
B Compile-time error
C No output
try{
Console.Write(arr[10]);
finally{
Console.WriteLine("Error occurred!");
A Compile-timer error
B Error occurred!
https://www.tutorialsteacher.com/online-test/csharp-test2 5/7
7/16/2021 C# Test 2
Question 19: Which of the following is the built-in delegate function for handling events in
.NET?
Question 20: Events can also be declared static, virtual, sealed, and abstract.
A True
B False
TUTORIALSTEACHER.COM TUTORIALS
LINQ Sass
[email protected]
E-MAIL LIST
Subscribe to TutorialsTeacher email list and get latest updates, tips &
tricks on C#, .Net, JavaScript, jQuery, AngularJS,
Email address
https://www.tutorialsteacher.com/online-test/csharp-test2 6/7
7/16/2021 C# Test 2
GO
HOME
PRIVACY POLICY
TERMS OF USE
ADVERTISE WITH US 2020 TutorialsTeacher.com. All Rights Reserved.
https://www.tutorialsteacher.com/online-test/csharp-test2 7/7