int i = 1;
int j = 1;
System.Console.WriteLine(i == j);
System.Console.WriteLine(i.ToString() == j.ToString());
System.Console.WriteLine((object)i == (object)j);
Give the sample code above, what is the output to the console?
Answer Posted / sasi
static void Main(string[] args)
{
int i = 1, j = 1;
Console.WriteLine(i + j);
Console.WriteLine("\n" + i.ToString() + j.ToString());
Console.WriteLine("\n"+((object)i==(object)j));
Console.ReadLine();
}
output:-
2
11
false
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
Why do we need constructor?
What is a console application in c#?
What is the default modifier for class in c#?
What is difference between const and static in c#?
What is int tryparse in c#?
What is getenumerator?
Which are access modifiers available in c#?
Explain how do I convert a string to an int in c#?
What is serialization in .net?
Can mvc be used for desktop applications?
What is private readonly in c#?
Define a manifest in .net?
Do loops c#?
Explain the difference between object type and dynamic type variables in c#?
What is the difference between dynamic type variables and object type variables in c#?