E
Eric Anderson
Would someone be kind and explain why and how this works. It comes up with the correct answer, but I dont understand how it does. Wouldn't Console.WriteLine("5+4={0}",5+4); wouldn't it come up as 5+4=1 instead of 5+4=9? Sorry guys im new to all of this but im learning. Thanks for the help in advance!
using System;
namespace SimpleMath
{
class DoMath
{
static void Main(string[] args)
{
int a = 1;
//addition with integers works as expected
Console.WriteLine("5 + 4 = {0}", 5 + 4);
Console.Write("Please press \"enter\" to continue");
Console.ReadLine();
} // end main
} // end class
} // end namespace
using System;
namespace SimpleMath
{
class DoMath
{
static void Main(string[] args)
{
int a = 1;
//addition with integers works as expected
Console.WriteLine("5 + 4 = {0}", 5 + 4);
Console.Write("Please press \"enter\" to continue");
Console.ReadLine();
} // end main
} // end class
} // end namespace