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
if you do have a stack overflow profile.what is your ranking?
list the steps in code compilation in c#?
What is difference between dll and exe in c#?
Is a structure a class?
What is the xml document structure?
What is namespace give the example?
Should I use double or float?
What are properties in c#. Explain with an example?
Do loops c#?
Explain how can I get around scope problems in a try/catch?
What is the difference between a field and a property in c#?
What is the difference between ref and out parameters in c#?
What does return do in for loop?
Can we have multiple constructors in a class c#?
Explain the difference between private and shared assembly?