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


Please Help Members By Posting Answers For Below Questions

What is 8 bit signed integer?

476


What does using do in c#?

515


What is the difference between a variable and a literal?

534


Why does my windows application pop up a console window every time I run it?

518


How do I port "synchronized" functions from visual j++ to c#?

482






Explain dataadapter.update method in .net?

515


What is dependency injection in simple words?

501


What sort algorithm does c# use?

503


Is a valid int value?

475


Explain the Different types of configuration files in .net?

569


What is an escape sequence in c#?

506


Is null == null c#?

475


Why would you use untrusted verification?

534


What is the components of window?

498


What is the meaning of 0 in c#?

526